mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Fix multiple postfix conditionals
This commit is contained in:
parent
6c786f0fb7
commit
d7862647d9
4 changed files with 25 additions and 6 deletions
|
@ -584,7 +584,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', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['right', 'POST_IF']];
|
||||
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', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['left', 'POST_IF']];
|
||||
|
||||
tokens = [];
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -592,7 +592,7 @@ operators = [
|
|||
['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS']
|
||||
['right', 'FORIN', 'FOROF', 'BY', 'WHEN']
|
||||
['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS']
|
||||
['right', 'POST_IF']
|
||||
['left', 'POST_IF']
|
||||
]
|
||||
|
||||
# Wrapping Up
|
||||
|
|
|
@ -198,6 +198,14 @@ test "#748: trailing reserved identifiers", ->
|
|||
nonce
|
||||
eq nonce, result
|
||||
|
||||
# Postfix
|
||||
|
||||
test "#3056: multiple postfix conditionals", ->
|
||||
temp = 'initial'
|
||||
temp = 'ignored' unless true if false
|
||||
eq temp, 'initial'
|
||||
|
||||
# Loops
|
||||
|
||||
test "basic `while` loops", ->
|
||||
|
||||
|
@ -296,6 +304,7 @@ test "break *not* at the top level", ->
|
|||
result
|
||||
eq 2, someFunc()
|
||||
|
||||
# Switch
|
||||
|
||||
test "basic `switch`", ->
|
||||
|
||||
|
@ -420,6 +429,7 @@ test "Issue #997. Switch doesn't fallthrough.", ->
|
|||
|
||||
eq val, 1
|
||||
|
||||
# Throw
|
||||
|
||||
test "Throw should be usable as an expression.", ->
|
||||
try
|
||||
|
|
Loading…
Add table
Reference in a new issue