vala r1681 - in trunk: . vala



Author: juergbi
Date: Mon Jul  7 12:40:16 2008
New Revision: 1681
URL: http://svn.gnome.org/viewvc/vala?rev=1681&view=rev

Log:
2008-07-07  JÃrg Billeter  <j bitron ch>

	* vala/valacharacterliteral.vala:
	* vala/valaparser.vala:

	Fix error message when encountering invalid character literals,
	fixes bug 541452


Modified:
   trunk/ChangeLog
   trunk/vala/valacharacterliteral.vala
   trunk/vala/valaparser.vala

Modified: trunk/vala/valacharacterliteral.vala
==============================================================================
--- trunk/vala/valacharacterliteral.vala	(original)
+++ trunk/vala/valacharacterliteral.vala	Mon Jul  7 12:40:16 2008
@@ -57,13 +57,7 @@
 		source_reference = source;
 
 	}
-	
-	construct {
-		if (error) {
-			Report.error (source_reference, "invalid character literal");
-		}
-	}
-	
+
 	public override void accept (CodeVisitor visitor) {
 		visitor.visit_character_literal (this);
 

Modified: trunk/vala/valaparser.vala
==============================================================================
--- trunk/vala/valaparser.vala	(original)
+++ trunk/vala/valaparser.vala	Mon Jul  7 12:40:16 2008
@@ -261,7 +261,12 @@
 			return new RealLiteral (get_last_string (), get_src (begin));
 		case TokenType.CHARACTER_LITERAL:
 			next ();
-			return new CharacterLiteral (get_last_string (), get_src (begin));
+			// FIXME validate and unescape here and just pass unichar to CharacterLiteral
+			var lit = new CharacterLiteral (get_last_string (), get_src (begin));
+			if (lit.error) {
+				Report.error (lit.source_reference, "invalid character literal");
+			}
+			return lit;
 		case TokenType.STRING_LITERAL:
 			next ();
 			return new StringLiteral (get_last_string (), get_src (begin));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]