Permalink
Browse files

Down to 90/29

  • Loading branch information...
1 parent 68757ed commit b034f03996793167f845acc6af3bbadc4ca23589 @txus committed Jan 24, 2012
Showing with 331 additions and 394 deletions.
  1. +4 −8 lib/noscript/parser/noscript.y
  2. +327 −386 lib/noscript/parser/parser.rb
@@ -98,21 +98,17 @@ rule
;
Array:
- '[' ArrayList ']' { result = ArrayLiteral.new(lineno, val[1]) }
+ '[]' { p 'parsing empty array!'; result = ArrayLiteral.new(lineno, []) }
+ | '[' ArrayList ']' { result = ArrayLiteral.new(lineno, val[1]) }
;
ArrayList:
/* nothing */ { result = [] }
- | ArrayListElement { result = [val[0]] }
- | ArrayList "," ArrayListElement { result = val[0] += [val[2]] }
+ | Expression { result = [val[0]] }
+ | ArrayList "," Expression { result = val[0] += [val[2]] }
| ArrayList Newline { result = val[0] }
;
- ArrayListElement:
- Expression { result = val[0] }
- | Newline Expression { result = val[1] }
- ;
-
Tuple:
'{' TupleList '}' { result = HashLiteral.new(lineno, val[1].flatten) }
| '{' TupleList Newline '}' { result = HashLiteral.new(lineno, val[1].flatten) }
Oops, something went wrong.

0 comments on commit b034f03

Please sign in to comment.