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: 16337b6cc97e
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c7f76cbf6c7a
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Nov 17, 2013

  1. Copy the full SHA
    7767ea3 View commit details
  2. Copy the full SHA
    630a547 View commit details
  3. Cleanup grammar op tokens

    adambeynon committed Nov 17, 2013
    Copy the full SHA
    c7f76cb View commit details
Showing with 2,032 additions and 2,025 deletions.
  1. +2,024 −2,017 lib/opal/parser/grammar.rb
  2. +6 −6 lib/opal/parser/grammar.y
  3. +2 −2 lib/opal/parser/lexer.rb
4,041 changes: 2,024 additions & 2,017 deletions lib/opal/parser/grammar.rb

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions lib/opal/parser/grammar.y
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
k__FILE__ tIDENTIFIER tFID tGVAR tIVAR tCONSTANT tCVAR tNTH_REF
tBACK_REF tSTRING_CONTENT tINTEGER tFLOAT tREGEXP_END '+@'
'-@' '-@NUM' tPOW tCMP tEQ tEQQ tNEQ tGEQ tLEQ tANDOP
tOROP tMATCH tNMATCH tDOT tDOT2 tDOT3 '[]' '[]=' tLSHFT tRSHFT
tOROP tMATCH tNMATCH tDOT tDOT2 tDOT3 tAREF tASET tLSHFT tRSHFT
tCOLON2 tCOLON3 tOP_ASGN tASSOC tLPAREN tLPAREN2 tRPAREN tLPAREN_ARG
ARRAY_BEG tRBRACK tLBRACE tLBRACE_ARG tSTAR tSTAR2 tAMPER tAMPER2
tTILDE tPERCENT tDIVIDE '+' '-' tLT tGT tPIPE tBANG tCARET
@@ -424,11 +424,11 @@ rule
result = val[0] << val[2]
}

op: tPIPE | tCARET | tAMPER2 | tCMP | tEQ | tEQQ
| tMATCH | tGT | tGEQ | tLT | tLEQ | tLSHFT
| tRSHFT | '+' | '-' | tSTAR2 | tSTAR | tDIVIDE
| tPERCENT | tPOW | tTILDE | '+@' | '-@' | '[]'
| '[]=' | tBACK_REF2 | tBANG | tNEQ
op: tPIPE | tCARET | tAMPER2 | tCMP | tEQ | tEQQ
| tMATCH | tNMATCH | tGT | tGEQ | tLT | tLEQ
| tNEQ | tLSHFT | tRSHFT | '+' | '-' | tSTAR2
| tSTAR | tDIVIDE | tPERCENT | tPOW | tBANG | tTILDE
| '+@' | '-@' | tAREF | tASET | tBACK_REF2

reswords: k__LINE__ | k__FILE__ | klBEGIN | klEND | kALIAS | kAND
| kBEGIN | kBREAK | kCASE | kCLASS | kDEF | kDEFINED
4 changes: 2 additions & 2 deletions lib/opal/parser/lexer.rb
Original file line number Diff line number Diff line change
@@ -802,9 +802,9 @@ def yylex
if [:expr_fname, :expr_dot].include? @lex_state
@lex_state = :expr_arg
if scan(/\]=/)
return '[]=', '[]='
return :tASET, '[]='
elsif scan(/\]/)
return '[]', '[]'
return :tAREF, '[]'
else
raise "Unexpected '[' token"
end