grasp-syntax-javascript
Advanced tools
Comparing version 0.1.0 to 0.2.0
157
index.js
@@ -1,2 +0,2 @@ | ||
// Generated by LiveScript 1.2.0 | ||
// Generated by LiveScript 1.4.0 | ||
(function(){ | ||
@@ -22,2 +22,7 @@ var ref$, each, keys, difference, intersection, syntax, syntaxFlat, i$, category, nodeName, node, complexTypes, complexTypeMap, key, val, aliasMap, matchesMap, matchesAliasMap, literals, literalMap, attrMap, attrMapInverse, alias, name, primitiveAttributesSet, nonPrimitiveAttributesSet, that, nonPrimitiveAttributes, primitiveAttributes, eitherAttributes, primitiveOnlyAttributes; | ||
}, | ||
RegExpLiteral: { | ||
alias: 'regex', | ||
primitives: ['regex'], | ||
example: '/^sh+/gi' | ||
}, | ||
Property: { | ||
@@ -30,2 +35,10 @@ alias: 'prop', | ||
note: 'An object expression (obj) has a list of properties, each being a property.' | ||
}, | ||
SpreadElement: { | ||
alias: 'spread', | ||
nodes: ['argument'] | ||
}, | ||
TemplateElement: { | ||
alias: 'template-element', | ||
primitives: ['tail', 'value'] | ||
} | ||
@@ -122,3 +135,3 @@ }, | ||
syntax: 'for ([*init*]; [*test*]; [*update*])\n *body*', | ||
example: 'for (var x = 0; x < 2; x++) {\n f(x);\n}' | ||
example: 'for (let x = 0; x < 2; x++) {\n f(x);\n}' | ||
}, | ||
@@ -129,4 +142,10 @@ ForInStatement: { | ||
syntax: 'for (*left* in *right*)\n *body*', | ||
example: 'for (prop in object) {\n f(object[prop]);\n}' | ||
example: 'for (let prop in object) {\n f(object[prop]);\n}' | ||
}, | ||
ForOfStatement: { | ||
alias: 'for-of', | ||
nodes: ['left', 'right', 'body'], | ||
syntax: 'for (*left* of *right*)\n *body*', | ||
example: 'for (let val of list) {\n f(val);\n}' | ||
}, | ||
DebuggerStatement: { | ||
@@ -143,2 +162,3 @@ alias: 'debugger', | ||
nodeArrays: ['params'], | ||
primitives: ['generator'], | ||
syntax: 'function *id*([*param_1*], [*param_2*], [..., *param_3*])\n *body*', | ||
@@ -168,2 +188,6 @@ example: 'function f(x, y) {\n return x * y;\n}', | ||
}, | ||
Super: { | ||
alias: 'super', | ||
example: 'super(x, y)' | ||
}, | ||
ArrayExpression: { | ||
@@ -185,6 +209,15 @@ alias: 'arr', | ||
nodeArrays: ['params'], | ||
primitives: ['generator'], | ||
syntax: 'function [*id*]([*param_1*], [*param_2*], [..., *param_3*])\n *body*', | ||
example: 'var f = function (x, y) {\n return x * y;\n}', | ||
example: 'let f = function(x, y) {\n return x * y;\n}', | ||
note: 'A function expression contrasts with a function declaration (func-dec).' | ||
}, | ||
ArrowFunctionExpression: { | ||
alias: 'arrow', | ||
nodes: ['id', 'body'], | ||
nodeArrays: ['params'], | ||
primitives: ['generator', 'expression'], | ||
syntax: '([*param_1*], [*param_2*], [..., *param_3*]) => *body*', | ||
example: '(x, y) => x * y' | ||
}, | ||
SequenceExpression: { | ||
@@ -196,2 +229,9 @@ alias: 'seq', | ||
}, | ||
YieldExpression: { | ||
alias: 'yield', | ||
nodes: ['argument'], | ||
primitive: ['delegate'], | ||
syntax: 'yield *argument*', | ||
example: 'yield x' | ||
}, | ||
UnaryExpression: { | ||
@@ -258,2 +298,10 @@ alias: 'unary', | ||
example: 'Math.PI' | ||
}, | ||
TemplateLiteral: { | ||
alias: 'template-literal', | ||
nodeArrays: ['quasis', 'expressions'] | ||
}, | ||
TaggedTemplateExpression: { | ||
alias: 'tagged-template-exp', | ||
nodes: ['tag', 'quasi'] | ||
} | ||
@@ -275,2 +323,95 @@ }, | ||
} | ||
}, | ||
Patterns: { | ||
AssignmentProperty: { | ||
alias: 'assign-prop', | ||
nodes: ['key', 'value'], | ||
primitives: ['kind', 'method'] | ||
}, | ||
ObjectPattern: { | ||
alias: 'obj-pattern', | ||
nodeArrays: ['properties'] | ||
}, | ||
ArrayPattern: { | ||
alias: 'array-pattern', | ||
nodeArrays: ['elements'] | ||
}, | ||
RestElement: { | ||
alias: 'rest-element', | ||
nodes: ['argument'] | ||
}, | ||
AssignmentPattern: { | ||
alias: 'assign-pattern', | ||
nodes: ['left', 'right'] | ||
} | ||
}, | ||
Classes: { | ||
ClassBody: { | ||
alias: 'class-body', | ||
nodeArrays: ['body'] | ||
}, | ||
MethodDefinition: { | ||
alias: 'method', | ||
nodes: ['key', 'value'], | ||
primitives: ['kind', 'computed', 'static'] | ||
}, | ||
ClassDeclaration: { | ||
alias: 'class-dec', | ||
nodes: ['id', 'superClass', 'body'] | ||
}, | ||
ClassExpression: { | ||
alias: 'class-exp', | ||
nodes: ['id', 'superClass', 'body'] | ||
}, | ||
MetaProperty: { | ||
alias: 'meta-property', | ||
nodes: ['meta', 'property'] | ||
} | ||
}, | ||
Modules: { | ||
ModuleDeclaration: { | ||
alias: 'module-dec' | ||
}, | ||
ModuleSpecifier: { | ||
alias: 'module-specifier', | ||
nodes: ['local'] | ||
} | ||
}, | ||
Imports: { | ||
ImportDeclaration: { | ||
alias: 'import-dec', | ||
nodes: ['source'], | ||
nodeArrays: ['specifiers'] | ||
}, | ||
ImportSpecifier: { | ||
alias: 'import-specifier', | ||
nodes: ['local', 'imported'] | ||
}, | ||
ImportDefaultSpecifier: { | ||
alias: 'import-default-specifier', | ||
nodes: ['local'] | ||
}, | ||
ImportNamespaceSpecifier: { | ||
alias: 'import-namespace-specifier', | ||
nodes: ['local'] | ||
} | ||
}, | ||
Exports: { | ||
ExportNamedDeclaration: { | ||
alias: 'export-named-dec', | ||
nodes: ['declaration', 'source'], | ||
nodeArrays: ['specifiers'] | ||
}, | ||
ExportSpecifier: { | ||
alias: 'export-specifier', | ||
nodes: ['local', 'exported'] | ||
}, | ||
ExportDefaultDeclaration: { | ||
alias: 'export-default-specifier', | ||
nodes: ['declaration'] | ||
}, | ||
ExportAllDeclarationSpecifier: { | ||
alias: 'export-namespace-specifier', | ||
nodes: ['source'] | ||
} | ||
} | ||
@@ -307,5 +448,6 @@ }; | ||
Function: ['FunctionDeclaration', 'FunctionExpression'], | ||
ForLoop: ['ForStatement', 'ForInStatement'], | ||
ForLoop: ['ForStatement', 'ForInStatement', 'ForOfStatement'], | ||
WhileLoop: ['DoWhileStatement', 'WhileStatement'], | ||
Loop: ['ForStatement', 'ForInStatement', 'DoWhileStatement', 'WhileStatement'] | ||
Class: ['ClassExpression', 'ClassExpression'], | ||
Loop: ['ForStatement', 'ForInStatement', 'ForOfStatement', 'DoWhileStatement', 'WhileStatement'] | ||
}; | ||
@@ -321,3 +463,4 @@ matchesAliasMap = { | ||
'while-loop': 'WhileLoop', | ||
loop: 'Loop' | ||
loop: 'Loop', | ||
'class': 'Class' | ||
}; | ||
@@ -324,0 +467,0 @@ literals = { |
{ | ||
"name": "grasp-syntax-javascript", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"author": "George Zahariev <z@georgezahariev.com>", | ||
@@ -21,8 +21,3 @@ "description": "grasp query engines common parts", | ||
"bugs": "https://github.com/gkz/grasp-syntax-javascript/issues", | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://raw.github.com/gkz/grasp-syntax-javascript/master/LICENSE" | ||
} | ||
], | ||
"license": "MIT", | ||
"engines": { | ||
@@ -36,9 +31,9 @@ "node": ">= 0.8.0" | ||
"dependencies": { | ||
"prelude-ls": "~1.0.3" | ||
"prelude-ls": "~1.1.2" | ||
}, | ||
"devDependencies": { | ||
"LiveScript": "~1.2.0", | ||
"mocha": "~1.8.2", | ||
"livescript": "~1.4.0", | ||
"mocha": "~2.1.0", | ||
"istanbul": "~0.1.43" | ||
} | ||
} |
# Grasp Syntax JavaScript | ||
JavaScipt AST info for [grasp](http://graspjs.com) - [on GitHub](https://github.com/gkz/grasp). | ||
JavaScript AST info for [grasp](http://graspjs.com) - [on GitHub](https://github.com/gkz/grasp). | ||
@@ -5,0 +5,0 @@ [JS AST reference page on grasp](http://graspjs.com/docs/syntax-js/). |
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
18539
533
+ Addedprelude-ls@1.1.2(transitive)
- Removedprelude-ls@1.0.3(transitive)
Updatedprelude-ls@~1.1.2