decaffeinate-parser
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -79,2 +79,11 @@ 'use strict'; | ||
function locationWithLastPosition(loc, last) { | ||
return { | ||
first_line: loc.first_line, | ||
first_column: loc.first_column, | ||
last_line: last.last_line, | ||
last_column: last.last_column | ||
}; | ||
} | ||
function mergeLocations(left, right) { | ||
@@ -330,2 +339,3 @@ var first_line = undefined; | ||
} | ||
node.locationData = locationWithLastPosition(node.locationData, node.body.locationData); | ||
if (node.object) { | ||
@@ -332,0 +342,0 @@ return makeNode('ForOf', node.locationData, { |
{ | ||
"name": "decaffeinate-parser", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A better AST for CoffeeScript, inspired by CoffeeScriptRedux.", | ||
@@ -5,0 +5,0 @@ "main": "lib/parser.js", |
@@ -16,2 +16,5 @@ # decaffeinate-parser | ||
* Single-line functions, `if` statements, etc. have blocks for bodies. | ||
* Virtual nodes (such as the `LogicalNotOp` generated by an `unless`) are | ||
marked as such with a `virtual: true` property. | ||
* `for-in` loops do not have an implicit `step` property. | ||
* Ranges of programs with indented blocks are correct. | ||
@@ -18,0 +21,0 @@ * `super` is supported in classes. |
@@ -44,2 +44,11 @@ import isChainedComparison from './util/isChainedComparison'; | ||
function locationWithLastPosition(loc, last) { | ||
return { | ||
first_line: loc.first_line, | ||
first_column: loc.first_column, | ||
last_line: last.last_line, | ||
last_column: last.last_column | ||
}; | ||
} | ||
function mergeLocations(left, right) { | ||
@@ -284,2 +293,3 @@ let first_line; | ||
} | ||
node.locationData = locationWithLastPosition(node.locationData, node.body.locationData); | ||
if (node.object) { | ||
@@ -286,0 +296,0 @@ return makeNode('ForOf', node.locationData, { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62650
1757
41