Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 027ec697b29e
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3ceee6dd4929
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Nov 17, 2013

  1. Copy the full SHA
    992192a View commit details
  2. Copy the full SHA
    3ceee6d View commit details
Showing with 2,039 additions and 2,038 deletions.
  1. +2,028 −2,027 lib/opal/parser/grammar.rb
  2. +10 −10 lib/opal/parser/grammar.y
  3. +1 −1 lib/opal/parser/lexer.rb
4,055 changes: 2,028 additions & 2,027 deletions lib/opal/parser/grammar.rb

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions lib/opal/parser/grammar.y
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
'::' '::@' tOP_ASGN tASSOC tLPAREN '(' ')' tLPAREN_ARG
ARRAY_BEG ']' tLBRACE tLBRACE_ARG tSTAR tSTAR2 '&@' tAMPER2
tTILDE tPERCENT tDIVIDE '+' '-' tLT tGT tPIPE tBANG tCARET
tLCURLY '}' tBACK_REF2 tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG
tLCURLY tRCURLY tBACK_REF2 tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG
tWORDS_BEG tAWORDS_BEG tSTRING_DBEG tSTRING_DVAR tSTRING_END tSTRING
tSYMBOL '\\n' tEH tCOLON ',' tSPACE ';' tLABEL tLAMBDA tLAMBEG kDO_LAMBDA

@@ -74,8 +74,9 @@ rule
}

top_stmt: stmt
| klBEGIN tLCURLY top_compstmt tRCURLY
{
result = val[0]
result = val[2]
}

bodystmt: compstmt opt_rescue opt_else opt_ensure
@@ -94,7 +95,7 @@ rule
end
}

stmts: none
stmts: # none
{
result = new_block
}
@@ -149,8 +150,7 @@ rule
{
result = s(:rescue_mod, val[0], val[2])
}
| klBEGIN tLCURLY compstmt '}'
| klEND tLCURLY compstmt '}'
| klEND tLCURLY compstmt tRCURLY
| lhs tEQL command_call
{
result = new_assign val[0], val[2]
@@ -234,7 +234,7 @@ rule
| block_call '.' operation2 command_args
| block_call '::' operation2 command_args

cmd_brace_block: tLBRACE_ARG opt_block_var compstmt '}'
cmd_brace_block: tLBRACE_ARG opt_block_var compstmt tRCURLY

command: operation command_args =tLOWEST
{
@@ -776,7 +776,7 @@ rule
{
result = val[1] || s(:array)
}
| '{' assoc_list '}'
| '{' assoc_list tRCURLY
{
result = s(:hash, *val[1])
}
@@ -991,7 +991,7 @@ rule
| block_param
| none

lambda_body: tLAMBEG compstmt '}'
lambda_body: tLAMBEG compstmt tRCURLY
{
result = val[1]
}
@@ -1154,7 +1154,7 @@ opt_block_args_tail: ',' block_args_tail
push_scope :block
result = lexer.line
}
opt_block_var compstmt '}'
opt_block_var compstmt tRCURLY
{
result = new_iter val[2], val[3]
result.line = val[1]
@@ -1342,7 +1342,7 @@ xstring_contents: none
lexer.strterm = nil
lexer.lex_state = :expr_beg
}
compstmt '}'
compstmt tRCURLY
{
lexer.strterm = val[1]
lexer.cond_lexpop
2 changes: 1 addition & 1 deletion lib/opal/parser/lexer.rb
Original file line number Diff line number Diff line change
@@ -831,7 +831,7 @@ def yylex
cmdarg_lexpop
@lex_state = :expr_end

return '}', scanner.matched
return :tRCURLY, scanner.matched

elsif scan(/\.\.\./)
@lex_state = :expr_beg