Comparing version 0.8.2 to 0.9.0
@@ -1105,3 +1105,3 @@ /* | ||
if (match('*') || match('/') || match('%')) { | ||
while (match('*') || match('/') || match('%')) { | ||
expr = { | ||
@@ -1111,3 +1111,3 @@ type: Syntax.BinaryExpression, | ||
left: expr, | ||
right: parseMultiplicativeExpression() | ||
right: parseUnaryExpression() | ||
}; | ||
@@ -1124,3 +1124,3 @@ } | ||
if (match('+') || match('-')) { | ||
while (match('+') || match('-')) { | ||
expr = { | ||
@@ -1130,3 +1130,3 @@ type: Syntax.BinaryExpression, | ||
left: expr, | ||
right: parseAdditiveExpression() | ||
right: parseMultiplicativeExpression() | ||
}; | ||
@@ -1143,8 +1143,8 @@ } | ||
if (match('<<') || match('>>') || match('>>>')) { | ||
return { | ||
while (match('<<') || match('>>') || match('>>>')) { | ||
expr = { | ||
type: Syntax.BinaryExpression, | ||
operator: lex().value, | ||
left: expr, | ||
right: parseShiftExpression() | ||
right: parseAdditiveExpression() | ||
}; | ||
@@ -1194,3 +1194,3 @@ } | ||
if (match('==') || match('!=') || match('===') || match('!==')) { | ||
while (match('==') || match('!=') || match('===') || match('!==')) { | ||
expr = { | ||
@@ -1200,3 +1200,3 @@ type: Syntax.BinaryExpression, | ||
left: expr, | ||
right: parseEqualityExpression() | ||
right: parseRelationalExpression() | ||
}; | ||
@@ -1213,3 +1213,3 @@ } | ||
if (match('&')) { | ||
while (match('&')) { | ||
lex(); | ||
@@ -1220,3 +1220,3 @@ expr = { | ||
left: expr, | ||
right: parseBitwiseANDExpression() | ||
right: parseEqualityExpression() | ||
}; | ||
@@ -1231,3 +1231,3 @@ } | ||
if (match('|')) { | ||
while (match('|')) { | ||
lex(); | ||
@@ -1238,3 +1238,3 @@ expr = { | ||
left: expr, | ||
right: parseBitwiseORExpression() | ||
right: parseBitwiseANDExpression() | ||
}; | ||
@@ -1249,3 +1249,3 @@ } | ||
if (match('^')) { | ||
while (match('^')) { | ||
lex(); | ||
@@ -1256,3 +1256,3 @@ expr = { | ||
left: expr, | ||
right: parseBitwiseXORExpression() | ||
right: parseBitwiseORExpression() | ||
}; | ||
@@ -1269,3 +1269,3 @@ } | ||
if (match('&&')) { | ||
while (match('&&')) { | ||
lex(); | ||
@@ -1276,3 +1276,3 @@ expr = { | ||
left: expr, | ||
right: parseLogicalANDExpression() | ||
right: parseBitwiseXORExpression() | ||
}; | ||
@@ -1287,3 +1287,3 @@ } | ||
if (match('||')) { | ||
while (match('||')) { | ||
lex(); | ||
@@ -1294,3 +1294,3 @@ expr = { | ||
left: expr, | ||
right: parseLogicalORExpression() | ||
right: parseLogicalANDExpression() | ||
}; | ||
@@ -1570,11 +1570,8 @@ } | ||
lex(); | ||
init = parseVariableDeclarationList(); | ||
if (init.length === 1) { | ||
init = init[0]; | ||
} else { | ||
init = { | ||
type: Syntax.SequenceExpression, | ||
expressions: init | ||
}; | ||
} | ||
init = { | ||
type: Syntax.VariableDeclaration, | ||
declarations: parseVariableDeclarationList(), | ||
kind: 'var' | ||
}; | ||
if (matchKeyword('in')) { | ||
@@ -1631,3 +1628,4 @@ lex(); | ||
right: right, | ||
body: body | ||
body: body, | ||
each: false | ||
}; | ||
@@ -1767,6 +1765,3 @@ } | ||
consequent = { | ||
type: Syntax.BlockStatement, | ||
body: [] | ||
}; | ||
consequent = []; | ||
@@ -1777,3 +1772,3 @@ while (index < length) { | ||
} | ||
consequent.body.push(parseStatement()); | ||
consequent.push(parseStatement()); | ||
} | ||
@@ -1784,3 +1779,3 @@ | ||
test: test, | ||
consequent: [ consequent ] | ||
consequent: consequent | ||
}); | ||
@@ -2092,4 +2087,4 @@ } | ||
// Sync with package.json. | ||
exports.version = '0.8.2'; | ||
exports.version = '0.9.0'; | ||
}(typeof exports === 'undefined' ? (esprima = {}) : exports)); |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.8.2", | ||
"version": "0.9.0", | ||
"engines": { | ||
@@ -12,0 +12,0 @@ "node": ">=0.4.0" |
@@ -5,2 +5,18 @@ Esprima ([esprima.org](http://esprima.org)) is an experimental ECMAScript | ||
Esprima can be used in a web browser: | ||
<script src="esprima.js"></script> | ||
or in a Node.js application via the package manager: | ||
npm install esprima | ||
A very simple example: | ||
esprima.parse('var answer=42').body[0].declarations[0].init | ||
produces the following object: | ||
{ type: 'Literal', value: 42 } | ||
Esprima is still in the development, for now please check | ||
@@ -7,0 +23,0 @@ [the wiki documentation](http://wiki.esprima.org). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
3187101
14944
60