vala r1108 - in trunk: . vala



Author: juergbi
Date: Sat Mar  8 15:50:40 2008
New Revision: 1108
URL: http://svn.gnome.org/viewvc/vala?rev=1108&view=rev

Log:
2008-03-08  Juerg Billeter  <j bitron ch>

	* vala/parser.y, vala/scanner.l: support declaration of local
	  multi-dimensional array variables


Modified:
   trunk/ChangeLog
   trunk/vala/parser.y
   trunk/vala/scanner.l

Modified: trunk/vala/parser.y
==============================================================================
--- trunk/vala/parser.y	(original)
+++ trunk/vala/parser.y	Sat Mar  8 15:50:40 2008
@@ -106,6 +106,7 @@
 %token OPEN_CAST_PARENS "cast ("
 %token CLOSE_PARENS ")"
 %token BRACKET_PAIR "[]"
+%token OPEN_ARRAY_TYPE_BRACKET "array ["
 %token OPEN_BRACKET "["
 %token CLOSE_BRACKET "]"
 %token ELLIPSIS "..."
@@ -768,9 +769,9 @@
 	;
 
 bracket_pair
-	: BRACKET_PAIR
+	: OPEN_ARRAY_TYPE_BRACKET opt_comma_list CLOSE_BRACKET
 	  {
-	  	$$ = 1;
+		$$ = $2;
 	  }
 	;
 

Modified: trunk/vala/scanner.l
==============================================================================
--- trunk/vala/scanner.l	(original)
+++ trunk/vala/scanner.l	Sat Mar  8 15:50:40 2008
@@ -81,7 +81,7 @@
 "("({space}"weak")?{space}{ident}("."{ident})?("<"({ident}".")?{ident}(","({ident}".")?{ident})*">")?("["{space}"]")*{space}")"{space}("("|{ident}|{literal})	{ yyless (1); uploc; return OPEN_CAST_PARENS; }
 "("		{ uploc; return OPEN_PARENS; }
 ")"		{ uploc; return CLOSE_PARENS; }
-"[]"		{ uploc; return BRACKET_PAIR; }
+"["{space}(","{space})*"]"	{ yyless (1); uploc; return OPEN_ARRAY_TYPE_BRACKET; }
 "["		{ uploc; return OPEN_BRACKET; }
 "]"		{ uploc; return CLOSE_BRACKET; }
 "..."		{ uploc; return ELLIPSIS; }



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