2008-03-08 Juerg Billeter <j@bitron.ch>
* vala/parser.y, vala/scanner.l: support declaration of local
multi-dimensional array variables
svn path=/trunk/; revision=1108
+2008-03-08 Jürg Billeter <j@bitron.ch>
+
+ * vala/parser.y, vala/scanner.l: support declaration of local
+ multi-dimensional array variables
+
2008-03-08 Jürg Billeter <j@bitron.ch>
* vapigen/valagidlparser.vala: improve instance delegate detection
%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 "..."
;
bracket_pair
- : BRACKET_PAIR
+ : OPEN_ARRAY_TYPE_BRACKET opt_comma_list CLOSE_BRACKET
{
- $$ = 1;
+ $$ = $2;
}
;
"("({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; }