void rollback (SourceLocation location) {
while (tokens[index].begin.pos != location.pos) {
- prev ();
+ index = (index - 1 + BUFFER_SIZE) % BUFFER_SIZE;
+ size++;
+ if (size > BUFFER_SIZE) {
+ scanner.seek (location);
+ size = 0;
+ index = 0;
+
+ next ();
+ }
}
}
do {
if (!first) {
// array of arrays: new T[][42]
+
+ if (size_specified) {
+ throw new ParseError.SYNTAX (get_error ("size of inner arrays must not be specified in array creation expression"));
+ }
+
etype = new ArrayType (etype, size_specifier_list.size, etype.source_reference);
} else {
first = false;
bool is_ident_char (char c) {
return (c.isalnum () || c == '_');
}
+
+ public void seek (SourceLocation location) {
+ current = location.pos;
+ line = location.line;
+ column = location.column;
+
+ conditional_stack = null;
+ state_stack = null;
+ }
TokenType get_identifier_or_keyword (char* begin, int len) {
switch (len) {