Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Zdenko Vujasinovic committed Jul 28, 2017
1 parent 5908448 commit 7af23b4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/coffeescript/nodes.js

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

2 changes: 1 addition & 1 deletion src/lexer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports.Lexer = class Lexer
i += consumed

return {@tokens, index: i} if opts.untilBalanced and @ends.length is 0

@closeIndentation()
@error "missing #{end.tag}", (end.origin ? end)[2] if end = @ends.pop()
return @tokens if opts.rewrite is off
Expand Down
3 changes: 1 addition & 2 deletions src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -884,13 +884,12 @@ exports.Call = class Call extends Base
for obj in attributes.base.objects
attr = obj.base
attrProps = attr?.properties or []
console.log attr, attrProps
# Catch invalid CSX attributes: <div {a:"b", props} {props} "value" />
if not (attr instanceof Obj or attr instanceof IdentifierLiteral) or (attr instanceof Obj and not attr.generated and (attrProps.length > 1 or not (attrProps[0] instanceof Splat)))
obj.error """
Unexpected token. Allowed CSX attributes are: id="val", src={source}, {props...} or attribute.
Example: <div id="val" src={getTheSource()} {props...} checked>hellow world</div>.
"""
"""
obj.base.csx = yes if obj.base instanceof Obj
fragments.push @makeCode ' '
fragments.push obj.compileToFragments(o, LEVEL_PAREN)...
Expand Down

0 comments on commit 7af23b4

Please sign in to comment.