Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/coffee-script/grammar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffee-script/lexer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions lib/coffee-script/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

215 changes: 107 additions & 108 deletions lib/coffee-script/parser.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/grammar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ grammar =
o 'EXPORT Identifier = INDENT Expression OUTDENT', -> new ExportNamedDeclaration new Assign $2, $5, null,
moduleDeclaration: 'export'
o 'EXPORT DEFAULT Expression', -> new ExportDefaultDeclaration $3
o 'EXPORT DEFAULT INDENT Object OUTDENT', -> new ExportDefaultDeclaration new Value $4
o 'EXPORT EXPORT_ALL FROM String', -> new ExportAllDeclaration new Literal($2), $4
o 'EXPORT { ExportSpecifierList OptComma } FROM String', -> new ExportNamedDeclaration new ExportSpecifierList($3), $7
]
Expand Down
2 changes: 1 addition & 1 deletion src/lexer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1096,4 +1096,4 @@ INDENTABLE_CLOSERS = [')', '}', ']']
# Tokens that, when appearing at the end of a line, suppress a following TERMINATOR/INDENT token
UNFINISHED = ['\\', '.', '?.', '?::', 'UNARY', 'MATH', 'UNARY_MATH', '+', '-',
'**', 'SHIFT', 'RELATION', 'COMPARE', '&', '^', '|', '&&', '||',
'BIN?', 'THROW', 'EXTENDS', 'DEFAULT']
'BIN?', 'THROW', 'EXTENDS']
21 changes: 20 additions & 1 deletion test/modules.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ test "export default implicit object", ->
test "export default multiline implicit object", ->
input = """
export default
foo: 'bar',
foo: 'bar'
baz: 'qux'
"""
output = """
Expand All @@ -369,6 +369,25 @@ test "export default multiline implicit object", ->
};"""
eq toJS(input), output

test "export default multiline implicit object with internal braces", ->
input = """
export default
foo: yes
bar: {
baz
}
quz: no
"""
output = """
export default {
foo: true,
bar: {
baz: baz
},
quz: false
};"""
eq toJS(input), output

test "export default assignment expression", ->
input = "export default foo = 'bar'"
output = """
Expand Down