Skip to content

Commit

Permalink
fix: redo fix for floats with leading periods (#113)
Browse files Browse the repository at this point in the history
This is the proper fix for decaffeinate/decaffeinate#682, specifically updating coffee-lex to lex numbers with a leading period as a single token.
  • Loading branch information
eventualbuddha authored Dec 30, 2016
1 parent 5a11097 commit b8e1c12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
],
"dependencies": {
"babylon": "^6.14.1",
"coffee-lex": "^5.0.0",
"coffee-lex": "^5.0.2",
"decaffeinate-coffeescript": "^1.10.0-patch9",
"lines-and-columns": "^1.1.6"
},
Expand Down
2 changes: 1 addition & 1 deletion src/mappers/mapLiteral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function mapLiteral(context: ParseContext, node: Literal): Node {
return new JavaScript(line, column, start, end, raw, virtual, node.value);
}

if (startToken.type === SourceType.NUMBER || startToken.type === SourceType.DOT) {
if (startToken.type === SourceType.NUMBER) {
if (raw.includes('.')) {
return new Float(line, column, start, end, raw, virtual, parseNumber(node.value));
} else {
Expand Down

0 comments on commit b8e1c12

Please sign in to comment.