Browse files

Coco 5622aef: grammar: POST_IF now has the same precedence as FOR/WHI…

…LE, making work as expected
  • Loading branch information...
1 parent 338e6d7 commit aa262ecf0eeb9534407c61a724cd1c0c9d82ab79 @jashkenas jashkenas committed Nov 20, 2010
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/grammar.js
  2. +1 −1 lib/parser.js
  3. +2 −2 src/grammar.coffee
View
2 lib/grammar.js
@@ -556,7 +556,7 @@
})
]
};
- operators = [['left', '.', '?.', '::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'UNLESS', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['right', 'POST_IF', 'POST_UNLESS']];
+ operators = [['left', '.', '?.', '::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'UNLESS', 'ELSE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['left', 'POST_IF', 'POST_UNLESS', 'FOR', 'WHILE']];
tokens = [];
for (name in grammar) {
alternatives = grammar[name];
View
2 lib/parser.js
1 addition, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
4 src/grammar.coffee
@@ -566,8 +566,8 @@ operators = [
['nonassoc', 'INDENT', 'OUTDENT']
['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS']
['right', 'FORIN', 'FOROF', 'BY', 'WHEN']
- ['right', 'IF', 'UNLESS', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS']
- ['right', 'POST_IF', 'POST_UNLESS']
+ ['right', 'IF', 'UNLESS', 'ELSE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS']
+ ['left', 'POST_IF', 'POST_UNLESS', 'FOR', 'WHILE']
]
# Wrapping Up

0 comments on commit aa262ec

Please sign in to comment.