diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 3c078e9f9..000000000 --- a/.babelrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "presets": [ - "es2015" - ] -} diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 4e0fb5920..000000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,8 +0,0 @@ -exclude_patterns: -- "coverage/" -- "node_modules/" -- "test/" -- "tutorials/" -- "docs/" -- "dist/" -- "example/" diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 2c5b2a4bf..000000000 --- a/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -repo_token: de6RJbSSDNAPxIegg5fAEjIPHRrVhxRiF \ No newline at end of file diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 7e119d954..000000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -/dist -/docs -/example -/tutorials diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 21a45027a..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - root: true, - parserOptions: { - ecmaVersion: 2017, - sourceType: "module" - }, - plugins: ["prettier"], - extends: ["eslint:recommended", "prettier"], - env: { - browser: true, - node: true, - mocha: true, - jest: true, - es6: true - }, - rules: { - "prefer-const": "error", - "no-var": "error", - "prettier/prettier": "error" - } -}; diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5ba3c1599..000000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/node_modules -/.project -/npm-debug.log -/nbproject -/coverage -/docs -*.swp diff --git a/.istanbul.yml b/.istanbul.yml deleted file mode 100644 index c2fa0db84..000000000 --- a/.istanbul.yml +++ /dev/null @@ -1,53 +0,0 @@ -verbose: false -instrumentation: - root: . - extensions: - - .js - default-excludes: true - excludes: [] - embed-source: false - variable: __coverage__ - compact: true - preserve-comments: false - complete-copy: false - save-baseline: false - baseline-file: ./coverage/coverage-baseline.json - include-all-sources: false - include-pid: false -reporting: - print: summary - reports: - - lcov - dir: ./coverage - watermarks: - statements: [50, 80] - lines: [50, 80] - functions: [50, 80] - branches: [50, 80] - report-config: - clover: {file: clover.xml} - cobertura: {file: cobertura-coverage.xml} - json: {file: coverage-final.json} - json-summary: {file: coverage-summary.json} - lcovonly: {file: lcov.info} - teamcity: {file: null, blockName: Code Coverage Summary} - text: {file: null, maxCols: 0} - text-lcov: {file: lcov.info} - text-summary: {file: null} -hooks: - hook-run-in-context: false - post-require-hook: null - handle-sigint: false -check: - global: - statements: 0 - lines: 0 - branches: 0 - functions: 0 - excludes: [] - each: - statements: 0 - lines: 0 - branches: 0 - functions: 0 - excludes: [] \ No newline at end of file diff --git a/.jsdoc.json b/.jsdoc.json deleted file mode 100644 index 6ee8ce1c1..000000000 --- a/.jsdoc.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "tags": { - "allowUnknownTags": true - }, - "source": { - "include": ["src"], - "includePattern": ".+\\.js(doc|x)?$", - "excludePattern": "(^|\\/|\\\\)_" - }, - "plugins": ["plugins/markdown"], - "markdown": { - "idInHeadings": true - }, - "templates": { - "referenceTitle": "php-parser", - "cleverLinks": true, - "monospaceLinks": true, - "default": { - "outputSourceFiles": true - } - }, - "opts": { - "template": "node_modules/jsdoc-template", - "tutorials": "tutorials", - "destination": "docs", - "readme": "README.md", - "recurse": true - } -} diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 5ea9b176d..000000000 --- a/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -/docs/ -/test/ -/example/ -/tutorials/ -/coverage/ -/.vscode/ -/.babelrc -/.codeclimate.yml -/.coveralls.yml -/.eslintrc.js -/.eslintignore -/.jsdoc.json -/.istanbul.yml -/.travis.yml -/webpack.config.js \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c80fc0b4d..000000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: node_js -node_js: - - '6' -cache: - bundler: true - directories: - - node_modules # NPM package -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build -notifications: - email: false - webhooks: - urls: - - https://webhooks.gitter.im/e/f1d48355795bf25a8f9a - on_success: change - on_failure: always - on_start: never -script: npm run lint && npm run cover -after_success: cat /home/travis/build/glayzzle/php-parser/coverage/lcov.info | /home/travis/build/glayzzle/php-parser/node_modules/coveralls/bin/coveralls.js -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT diff --git a/AST.html b/AST.html new file mode 100644 index 000000000..062af5152 --- /dev/null +++ b/AST.html @@ -0,0 +1,634 @@ + + + + + + + + + AST - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ AST +

+ + + + +
+
+ +

+ + AST + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new AST() +

+
+ + + + + +
+

The AST builder class

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
withPositions + + + + Boolean + + + + + + + +

Should locate any node (by default false)

+
withSource + + + + Boolean + + + + + + + +

Should extract the node original code (by default false)

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + +
Tutorials:
+
+
    + +
  • + AST +
  • + +
+
+ + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ prepare(kind, parser) → {function} +

+
+ + + + + +
+

Prepares an AST node

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
kind + + + + String + + + | + + + null + + + + + + + +

Defines the node type +(if null, the kind must be passed at the function call)

+ +
parser + + + + Parser + + + + + + + +

The parser instance (use for extracting locations)

+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ resolvePrecedence() +

+
+ + + + + +
+

Check and fix precence, by default using right

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Array.html b/Array.html new file mode 100644 index 000000000..e86fbd556 --- /dev/null +++ b/Array.html @@ -0,0 +1,542 @@ + + + + + + + + + Array - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Array +

+ + + + +
+
+ +

+ + Array + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Array() +

+
+ + + + + +
+

Defines an array structure

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
items + + + + Entry + + + | + + + Expr + + + | + + + Variable + + + + + + + +

List of array items

+
shortForm + + + + boolean + + + + + + + +

Indicate if the short array syntax is used, ex [] instead array()

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
Example
+ + +
// PHP code :
[1, 'foo' => 'bar', 3]

// AST structure :
{
 "kind": "array",
 "shortForm": true
 "items": [
   {"kind": "number", "value": "1"},
   {
     "kind": "entry",
     "key": {"kind": "string", "value": "foo", "isDoubleQuote": false},
     "value": {"kind": "string", "value": "bar", "isDoubleQuote": false}
   },
   {"kind": "number", "value": "3"}
 ]
}
+ + +
+ + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Assign.html b/Assign.html new file mode 100644 index 000000000..80bc9545c --- /dev/null +++ b/Assign.html @@ -0,0 +1,545 @@ + + + + + + + + + Assign - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Assign +

+ + + + +
+
+ +

+ + Assign + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Assign() +

+
+ + + + + +
+

Assigns a value to the specified target

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
left + + + + Expression + + + + + + + + +
right + + + + Expression + + + + + + + + +
operator + + + + String + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Bin.html b/Bin.html new file mode 100644 index 000000000..08bfa6e25 --- /dev/null +++ b/Bin.html @@ -0,0 +1,545 @@ + + + + + + + + + Bin - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Bin +

+ + + + +
+
+ +

+ + Bin + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Bin() +

+
+ + + + + +
+

Binary operations

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + + + String + + + + + + + + +
left + + + + Expression + + + + + + + + +
right + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Block.html b/Block.html new file mode 100644 index 000000000..e27da4084 --- /dev/null +++ b/Block.html @@ -0,0 +1,487 @@ + + + + + + + + + Block - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Block +

+ + + + +
+
+ +

+ + Block + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Block() +

+
+ + + + + +
+

A block statement, i.e., a sequence of statements surrounded by braces.

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
children + + + + Array.<Node> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Boolean.html b/Boolean.html new file mode 100644 index 000000000..65f7c258d --- /dev/null +++ b/Boolean.html @@ -0,0 +1,429 @@ + + + + + + + + + Boolean - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Boolean +

+ + + + +
+
+ +

+ + Boolean + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Boolean() +

+
+ + + + + +
+

Defines a boolean value (true/false)

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Break.html b/Break.html new file mode 100644 index 000000000..992052ba7 --- /dev/null +++ b/Break.html @@ -0,0 +1,493 @@ + + + + + + + + + Break - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Break +

+ + + + +
+
+ +

+ + Break + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Break() +

+
+ + + + + +
+

A break statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
level + + + + Number + + + | + + + Null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 8d4ec213d..000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at i.chiriac@yahoo.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index c24acde54..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ -Everyone is welcome to contribute, just use the same coding style, and cover with tests your code. - -Any PR is welcomed :) diff --git a/Call.html b/Call.html new file mode 100644 index 000000000..a687fb3f3 --- /dev/null +++ b/Call.html @@ -0,0 +1,528 @@ + + + + + + + + + Call - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Call +

+ + + + +
+
+ +

+ + Call + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Call() +

+
+ + + + + +
+

Executes a call statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
what + + + + Identifier + + + | + + + Variable + + + | + + + ? + + + + + + + + +
arguments + + + + Array.<Arguments> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Case.html b/Case.html new file mode 100644 index 000000000..6c3999969 --- /dev/null +++ b/Case.html @@ -0,0 +1,528 @@ + + + + + + + + + Case - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Case +

+ + + + +
+
+ +

+ + Case + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Case() +

+
+ + + + + +
+

A switch case statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
test + + + + Expression + + + | + + + null + + + + + + + +

if null, means that the default case

+
body + + + + Block + + + | + + + null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Cast.html b/Cast.html new file mode 100644 index 000000000..7a240b756 --- /dev/null +++ b/Cast.html @@ -0,0 +1,545 @@ + + + + + + + + + Cast - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Cast +

+ + + + +
+
+ +

+ + Cast + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Cast() +

+
+ + + + + +
+

Binary operations

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + + + String + + + + + + + + +
raw + + + + String + + + + + + + + +
what + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Catch.html b/Catch.html new file mode 100644 index 000000000..4cd2bf117 --- /dev/null +++ b/Catch.html @@ -0,0 +1,556 @@ + + + + + + + + + Catch - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Catch +

+ + + + +
+
+ +

+ + Catch + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Catch() +

+
+ + + + + +
+

Defines a catch statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
what + + + + Array.<Identifier> + + + + + + + + +
variable + + + + Variable + + + + + + + + +
body + + + + Statement + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Class.html b/Class.html new file mode 100644 index 000000000..dc6fd27b0 --- /dev/null +++ b/Class.html @@ -0,0 +1,793 @@ + + + + + + + + + Class - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Class +

+ + + + +
+
+ +

+ + Class + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Class() +

+
+ + + + + +
+

A class definition

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
extends + + + + Identifier + + + | + + + null + + + + + + + + +
implements + + + + Array.<Identifier> + + + + + + + + +
body + + + + Array.<Declaration> + + + + + + + + +
isAnonymous + + + + boolean + + + + + + + + +
isAbstract + + + + boolean + + + + + + + + +
isFinal + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/ClassConstant.html b/ClassConstant.html new file mode 100644 index 000000000..28c932729 --- /dev/null +++ b/ClassConstant.html @@ -0,0 +1,671 @@ + + + + + + + + + ClassConstant - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ClassConstant +

+ + + + +
+
+ +

+ + ClassConstant + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new ClassConstant() +

+
+ + + + + +
+

Defines a class/interface/trait constant

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
isStatic + + + + boolean + + + + + + + + +
visibility + + + + string + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Clone.html b/Clone.html new file mode 100644 index 000000000..75b814fa6 --- /dev/null +++ b/Clone.html @@ -0,0 +1,487 @@ + + + + + + + + + Clone - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Clone +

+ + + + +
+
+ +

+ + Clone + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Clone() +

+
+ + + + + +
+

Defines a clone call

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
what + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Closure.html b/Closure.html new file mode 100644 index 000000000..7f6abf306 --- /dev/null +++ b/Closure.html @@ -0,0 +1,667 @@ + + + + + + + + + Closure - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Closure +

+ + + + +
+
+ +

+ + Closure + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Closure() +

+
+ + + + + +
+

Defines a closure

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + + + Array.<Parameter> + + + + + + + + +
uses + + + + Array.<Variable> + + + + + + + + +
type + + + + Identifier + + + + + + + + +
byref + + + + boolean + + + + + + + + +
nullable + + + + boolean + + + + + + + + +
body + + + + Block + + + | + + + null + + + + + + + + +
isStatic + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Comment.html b/Comment.html new file mode 100644 index 000000000..9a7f46c43 --- /dev/null +++ b/Comment.html @@ -0,0 +1,487 @@ + + + + + + + + + Comment - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Comment +

+ + + + +
+
+ +

+ + Comment + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Comment() +

+
+ + + + + +
+

Abstract documentation node (ComentLine or CommentBlock)

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + + + String + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/CommentBlock.html b/CommentBlock.html new file mode 100644 index 000000000..000749c6d --- /dev/null +++ b/CommentBlock.html @@ -0,0 +1,429 @@ + + + + + + + + + CommentBlock - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ CommentBlock +

+ + + + +
+
+ +

+ + CommentBlock + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new CommentBlock() +

+
+ + + + + +
+

A comment block (multiline)

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/CommentLine.html b/CommentLine.html new file mode 100644 index 000000000..1917d03ed --- /dev/null +++ b/CommentLine.html @@ -0,0 +1,429 @@ + + + + + + + + + CommentLine - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ CommentLine +

+ + + + +
+
+ +

+ + CommentLine + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new CommentLine() +

+
+ + + + + +
+

A single line comment

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/ConstRef.html b/ConstRef.html new file mode 100644 index 000000000..e59cd7017 --- /dev/null +++ b/ConstRef.html @@ -0,0 +1,493 @@ + + + + + + + + + ConstRef - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ConstRef +

+ + + + +
+
+ +

+ + ConstRef + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new ConstRef() +

+
+ + + + + +
+

A constant reference

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + + + String + + + | + + + Node + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Constant.html b/Constant.html new file mode 100644 index 000000000..f0f1aad69 --- /dev/null +++ b/Constant.html @@ -0,0 +1,648 @@ + + + + + + + + + Constant - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Constant +

+ + + + +
+
+ +

+ + Constant + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Constant() +

+
+ + + + + +
+

Defines a namespace constant

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + + + Node + + + | + + + null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Continue.html b/Continue.html new file mode 100644 index 000000000..5c6dc4c9c --- /dev/null +++ b/Continue.html @@ -0,0 +1,493 @@ + + + + + + + + + Continue - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Continue +

+ + + + +
+
+ +

+ + Continue + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Continue() +

+
+ + + + + +
+

A continue statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
level + + + + Number + + + | + + + Null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Declaration.html b/Declaration.html new file mode 100644 index 000000000..f69673418 --- /dev/null +++ b/Declaration.html @@ -0,0 +1,633 @@ + + + + + + + + + Declaration - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Declaration +

+ + + + +
+
+ +

+ + Declaration + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Declaration() +

+
+ + + + + +
+

A declaration statement (function, class, interface...)

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + + + string + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Declare.html b/Declare.html new file mode 100644 index 000000000..948e13dc5 --- /dev/null +++ b/Declare.html @@ -0,0 +1,527 @@ + + + + + + + + + Declare - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Declare +

+ + + + +
+
+ +

+ + Declare + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Declare() +

+
+ + + + + +
+

The declare construct is used to set execution directives for a block of code

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
what + + + + Array.<Expression> + + + + + + + + +
mode + + + + String + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Do.html b/Do.html new file mode 100644 index 000000000..ca3333920 --- /dev/null +++ b/Do.html @@ -0,0 +1,516 @@ + + + + + + + + + Do - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Do +

+ + + + +
+
+ +

+ + Do + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Do() +

+
+ + + + + +
+

Defines a do/while statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
test + + + + Expression + + + + + + + + +
body + + + + Statement + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Echo.html b/Echo.html new file mode 100644 index 000000000..3a2bd49d7 --- /dev/null +++ b/Echo.html @@ -0,0 +1,487 @@ + + + + + + + + + Echo - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Echo +

+ + + + +
+
+ +

+ + Echo + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Echo() +

+
+ + + + + +
+

Defines system based call

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
shortForm + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Empty.html b/Empty.html new file mode 100644 index 000000000..39751f124 --- /dev/null +++ b/Empty.html @@ -0,0 +1,429 @@ + + + + + + + + + Empty - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Empty +

+ + + + +
+
+ +

+ + Empty + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Empty() +

+
+ + + + + +
+

Defines an empty check call

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Encapsed.html b/Encapsed.html new file mode 100644 index 000000000..d02b1eaeb --- /dev/null +++ b/Encapsed.html @@ -0,0 +1,522 @@ + + + + + + + + + Encapsed - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Encapsed +

+ + + + +
+
+ +

+ + Encapsed + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Encapsed() +

+
+ + + + + +
+

Defines an encapsed string (contains expressions)

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + + + String + + + + + + + +

Defines the type of encapsed string (shell, heredoc, string)

+
label + + + + String + + + | + + + Null + + + + + + + +

The heredoc label, defined only when the type is heredoc

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Entry.html b/Entry.html new file mode 100644 index 000000000..338549396 --- /dev/null +++ b/Entry.html @@ -0,0 +1,522 @@ + + + + + + + + + Entry - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Entry +

+ + + + +
+
+ +

+ + Entry + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Entry() +

+
+ + + + + +
+

An array entry - see Array

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + + + Node + + + | + + + null + + + + + + + +

The entry key/offset

+
value + + + + Node + + + + + + + +

The entry value

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Error.html b/Error.html new file mode 100644 index 000000000..1bd18a8f5 --- /dev/null +++ b/Error.html @@ -0,0 +1,586 @@ + + + + + + + + + Error - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Error +

+ + + + +
+
+ +

+ + Error + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Error() +

+
+ + + + + +
+

Defines an error node (used only on silentMode)

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + + + string + + + + + + + + +
line + + + + number + + + + + + + + +
token + + + + number + + + | + + + string + + + + + + + + +
expected + + + + string + + + | + + + array + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Eval.html b/Eval.html new file mode 100644 index 000000000..8ed3a1dd1 --- /dev/null +++ b/Eval.html @@ -0,0 +1,487 @@ + + + + + + + + + Eval - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Eval +

+ + + + +
+
+ +

+ + Eval + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Eval() +

+
+ + + + + +
+

Defines an eval statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
source + + + + Node + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Exit.html b/Exit.html new file mode 100644 index 000000000..0729705e4 --- /dev/null +++ b/Exit.html @@ -0,0 +1,522 @@ + + + + + + + + + Exit - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Exit +

+ + + + +
+
+ +

+ + Exit + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Exit() +

+
+ + + + + +
+

Defines an exit / die call

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
status + + + + Node + + + | + + + null + + + + + + + + +
useDie + + + + Boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Expression.html b/Expression.html new file mode 100644 index 000000000..b9b8d52d9 --- /dev/null +++ b/Expression.html @@ -0,0 +1,430 @@ + + + + + + + + + Expression - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Expression +

+ + + + +
+
+ +

+ + Expression + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Expression() +

+
+ + + + + +
+

Any expression node. Since the left-hand side of an assignment may +be any expression in general, an expression can also be a pattern.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/For.html b/For.html new file mode 100644 index 000000000..9604683b3 --- /dev/null +++ b/For.html @@ -0,0 +1,614 @@ + + + + + + + + + For - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ For +

+ + + + +
+
+ +

+ + For + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new For() +

+
+ + + + + +
+

Defines a for iterator

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
init + + + + Array.<Expression> + + + + + + + + +
test + + + + Array.<Expression> + + + + + + + + +
increment + + + + Array.<Expression> + + + + + + + + +
body + + + + Statement + + + + + + + + +
shortForm + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Foreach.html b/Foreach.html new file mode 100644 index 000000000..43b9c2eb6 --- /dev/null +++ b/Foreach.html @@ -0,0 +1,620 @@ + + + + + + + + + Foreach - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Foreach +

+ + + + +
+
+ +

+ + Foreach + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Foreach() +

+
+ + + + + +
+

Defines a foreach iterator

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
source + + + + Expression + + + + + + + + +
key + + + + Expression + + + | + + + null + + + + + + + + +
value + + + + Expression + + + + + + + + +
body + + + + Statement + + + + + + + + +
shortForm + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Function.html b/Function.html new file mode 100644 index 000000000..4dbd067c0 --- /dev/null +++ b/Function.html @@ -0,0 +1,764 @@ + + + + + + + + + Function - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Function +

+ + + + +
+
+ +

+ + Function + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Function() +

+
+ + + + + +
+

Defines a classic function

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + + + Array.<Parameter> + + + + + + + + +
type + + + + Identifier + + + + + + + + +
byref + + + + boolean + + + + + + + + +
nullable + + + + boolean + + + + + + + + +
body + + + + Block + + + | + + + null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Global_.html b/Global_.html new file mode 100644 index 000000000..d451f4e7d --- /dev/null +++ b/Global_.html @@ -0,0 +1,487 @@ + + + + + + + + + Global - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Global +

+ + + + +
+
+ +

+ + Global + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Global() +

+
+ + + + + +
+

Imports a variable from the global scope

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
items + + + + Array.<Variable> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Goto.html b/Goto.html new file mode 100644 index 000000000..b8e32fdde --- /dev/null +++ b/Goto.html @@ -0,0 +1,498 @@ + + + + + + + + + Goto - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Goto +

+ + + + +
+
+ +

+ + Goto + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Goto() +

+
+ + + + + +
+

Defines goto statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
label + + + + String + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Halt.html b/Halt.html new file mode 100644 index 000000000..dbf5ddc73 --- /dev/null +++ b/Halt.html @@ -0,0 +1,498 @@ + + + + + + + + + Halt - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Halt +

+ + + + +
+
+ +

+ + Halt + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Halt() +

+
+ + + + + +
+

Halts the compiler execution

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
after + + + + String + + + + + + + +

String after the halt statement

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Identifier.html b/Identifier.html new file mode 100644 index 000000000..9041cd1d5 --- /dev/null +++ b/Identifier.html @@ -0,0 +1,516 @@ + + + + + + + + + Identifier - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Identifier +

+ + + + +
+
+ +

+ + Identifier + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Identifier() +

+
+ + + + + +
+

Defines an identifier node

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + + + string + + + + + + + + +
resolution + + + + string + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/If.html b/If.html new file mode 100644 index 000000000..c44434f41 --- /dev/null +++ b/If.html @@ -0,0 +1,586 @@ + + + + + + + + + If - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ If +

+ + + + +
+
+ +

+ + If + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new If() +

+
+ + + + + +
+

Defines a if statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
test + + + + Expression + + + + + + + + +
body + + + + Block + + + + + + + + +
alternate + + + + Block + + + | + + + If + + + | + + + null + + + + + + + + +
shortForm + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Include.html b/Include.html new file mode 100644 index 000000000..64ff42cea --- /dev/null +++ b/Include.html @@ -0,0 +1,545 @@ + + + + + + + + + Include - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Include +

+ + + + +
+
+ +

+ + Include + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Include() +

+
+ + + + + +
+

Defines system include call

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
target + + + + Node + + + + + + + + +
once + + + + boolean + + + + + + + + +
require + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Inline.html b/Inline.html new file mode 100644 index 000000000..3b0eb815e --- /dev/null +++ b/Inline.html @@ -0,0 +1,429 @@ + + + + + + + + + Inline - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Inline +

+ + + + +
+
+ +

+ + Inline + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Inline() +

+
+ + + + + +
+

Defines inline html output (treated as echo output)

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Interface.html b/Interface.html new file mode 100644 index 000000000..71d4a7730 --- /dev/null +++ b/Interface.html @@ -0,0 +1,671 @@ + + + + + + + + + Interface - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Interface +

+ + + + +
+
+ +

+ + Interface + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Interface() +

+
+ + + + + +
+

An interface definition

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
extends + + + + Array.<Identifier> + + + + + + + + +
body + + + + Array.<Declaration> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Isset.html b/Isset.html new file mode 100644 index 000000000..f47f76892 --- /dev/null +++ b/Isset.html @@ -0,0 +1,429 @@ + + + + + + + + + Isset - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Isset +

+ + + + +
+
+ +

+ + Isset + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Isset() +

+
+ + + + + +
+

Defines an isset call

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 66f0c9a88..000000000 --- a/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014, Glayzzle -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of test-bsd nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/Label.html b/Label.html new file mode 100644 index 000000000..f0d45ecfb --- /dev/null +++ b/Label.html @@ -0,0 +1,487 @@ + + + + + + + + + Label - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Label +

+ + + + +
+
+ +

+ + Label + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Label() +

+
+ + + + + +
+

A label statement (referenced by goto)

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + + + String + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/List.html b/List.html new file mode 100644 index 000000000..8bcb43a2d --- /dev/null +++ b/List.html @@ -0,0 +1,487 @@ + + + + + + + + + List - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ List +

+ + + + +
+
+ +

+ + List + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new List() +

+
+ + + + + +
+

Defines list assignment

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
shortForm + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Literal.html b/Literal.html new file mode 100644 index 000000000..b03cb7b5e --- /dev/null +++ b/Literal.html @@ -0,0 +1,540 @@ + + + + + + + + + Literal - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Literal +

+ + + + +
+
+ +

+ + Literal + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Literal() +

+
+ + + + + +
+

Defines an array structure

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
raw + + + + string + + + + + + + + +
value + + + + Node + + + | + + + string + + + | + + + number + + + | + + + boolean + + + | + + + null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Location.html b/Location.html new file mode 100644 index 000000000..228f98ad9 --- /dev/null +++ b/Location.html @@ -0,0 +1,381 @@ + + + + + + + + + Location - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Location +

+ + + + +
+
+ +

+ + Location + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Location() +

+
+ + + + + +
+

Defines the location of the node (with it's source contents as string)

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
source + + + + String + + + | + + + null + + + + + + + + +
start + + + + Position + + + + + + + + +
end + + + + Position + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Lookup.html b/Lookup.html new file mode 100644 index 000000000..62acdd0f8 --- /dev/null +++ b/Lookup.html @@ -0,0 +1,516 @@ + + + + + + + + + Lookup - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Lookup +

+ + + + +
+
+ +

+ + Lookup + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Lookup() +

+
+ + + + + +
+

Lookup on an offset in the specified object

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
what + + + + Expression + + + + + + + + +
offset + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Magic.html b/Magic.html new file mode 100644 index 000000000..a9f94aff0 --- /dev/null +++ b/Magic.html @@ -0,0 +1,429 @@ + + + + + + + + + Magic - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Magic +

+ + + + +
+
+ +

+ + Magic + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Magic() +

+
+ + + + + +
+

Defines magic constant

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Method.html b/Method.html new file mode 100644 index 000000000..811a3f688 --- /dev/null +++ b/Method.html @@ -0,0 +1,729 @@ + + + + + + + + + Method - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Method +

+ + + + +
+
+ +

+ + Method + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Method() +

+
+ + + + + +
+

Defines a class/interface/trait method

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
isAbstract + + + + boolean + + + + + + + + +
isFinal + + + + boolean + + + + + + + + +
isStatic + + + + boolean + + + + + + + + +
visibility + + + + string + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Namespace.html b/Namespace.html new file mode 100644 index 000000000..8eb121c34 --- /dev/null +++ b/Namespace.html @@ -0,0 +1,516 @@ + + + + + + + + + Namespace - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Namespace +

+ + + + +
+
+ +

+ + Namespace + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Namespace() +

+
+ + + + + +
+

The main program node

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + + + String + + + + + + + + +
withBrackets + + + + Boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/New.html b/New.html new file mode 100644 index 000000000..f18d4f311 --- /dev/null +++ b/New.html @@ -0,0 +1,528 @@ + + + + + + + + + New - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ New +

+ + + + +
+
+ +

+ + New + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new New() +

+
+ + + + + +
+

Creates a new instance of the specified class

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
what + + + + Identifier + + + | + + + Variable + + + | + + + Class + + + + + + + + +
arguments + + + + Array.<Arguments> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Node.html b/Node.html new file mode 100644 index 000000000..e724c6146 --- /dev/null +++ b/Node.html @@ -0,0 +1,734 @@ + + + + + + + + + Node - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Node +

+ + + + +
+
+ +

+ + Node + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Node() +

+
+ + + + + +
+

A generic AST node

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
loc + + + + Location + + + | + + + null + + + + + + + + + + + + +
leadingComments + + + + Array.<Comment> + + + + + + + + + + + + +
trailingComments + + + + Array.<Comment> + + + + + + + + + + + <nullable>
+ +
+ +
kind + + + + String + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ (static) extends(constructor) → {function} +

+
+ + + + + +
+

Helper for extending the Node class

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
constructor + + + + function + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Number.html b/Number.html new file mode 100644 index 000000000..b05913277 --- /dev/null +++ b/Number.html @@ -0,0 +1,429 @@ + + + + + + + + + Number - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Number +

+ + + + +
+
+ +

+ + Number + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Number() +

+
+ + + + + +
+

Defines a numeric value

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/OffsetLookup.html b/OffsetLookup.html new file mode 100644 index 000000000..e9294c0e1 --- /dev/null +++ b/OffsetLookup.html @@ -0,0 +1,429 @@ + + + + + + + + + OffsetLookup - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ OffsetLookup +

+ + + + +
+
+ +

+ + OffsetLookup + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new OffsetLookup() +

+
+ + + + + +
+

Lookup on an offset in an array

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Operation.html b/Operation.html new file mode 100644 index 000000000..3fd32da4b --- /dev/null +++ b/Operation.html @@ -0,0 +1,429 @@ + + + + + + + + + Operation - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Operation +

+ + + + +
+
+ +

+ + Operation + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Operation() +

+
+ + + + + +
+

Defines binary operations

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Parameter.html b/Parameter.html new file mode 100644 index 000000000..994e1996f --- /dev/null +++ b/Parameter.html @@ -0,0 +1,770 @@ + + + + + + + + + Parameter - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Parameter +

+ + + + +
+
+ +

+ + Parameter + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Parameter() +

+
+ + + + + +
+

Defines a function parameter

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + + + Identifier + + + | + + + null + + + + + + + + +
value + + + + Node + + + | + + + null + + + + + + + + +
byref + + + + boolean + + + + + + + + +
variadic + + + + boolean + + + + + + + + +
nullable + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Parenthesis.html b/Parenthesis.html new file mode 100644 index 000000000..176272af8 --- /dev/null +++ b/Parenthesis.html @@ -0,0 +1,487 @@ + + + + + + + + + Parenthesis - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Parenthesis +

+ + + + +
+
+ +

+ + Parenthesis + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Parenthesis() +

+
+ + + + + +
+

Parenthesis encapsulation (... expr ...)

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
inner + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Position.html b/Position.html new file mode 100644 index 000000000..b1b53e2ef --- /dev/null +++ b/Position.html @@ -0,0 +1,375 @@ + + + + + + + + + Position - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Position +

+ + + + +
+
+ +

+ + Position + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Position() +

+
+ + + + + +
+

Each Position object consists of a line number (1-indexed) and a column number (0-indexed):

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
line + + + + Number + + + + + + + + +
column + + + + Number + + + + + + + + +
offset + + + + Number + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Post.html b/Post.html new file mode 100644 index 000000000..0382c20db --- /dev/null +++ b/Post.html @@ -0,0 +1,516 @@ + + + + + + + + + Post - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Post +

+ + + + +
+
+ +

+ + Post + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Post() +

+
+ + + + + +
+

Defines a post operation $i++ or $i--

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + + + String + + + + + + + + +
what + + + + Variable + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Pre.html b/Pre.html new file mode 100644 index 000000000..936a63535 --- /dev/null +++ b/Pre.html @@ -0,0 +1,516 @@ + + + + + + + + + Pre - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Pre +

+ + + + +
+
+ +

+ + Pre + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Pre() +

+
+ + + + + +
+

Defines a pre operation ++$i or --$i

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + + + String + + + + + + + + +
what + + + + Variable + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Print.html b/Print.html new file mode 100644 index 000000000..f29f0802e --- /dev/null +++ b/Print.html @@ -0,0 +1,429 @@ + + + + + + + + + Print - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Print +

+ + + + +
+
+ +

+ + Print + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Print() +

+
+ + + + + +
+

Outputs

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Program.html b/Program.html new file mode 100644 index 000000000..211fb79f7 --- /dev/null +++ b/Program.html @@ -0,0 +1,569 @@ + + + + + + + + + Program - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Program +

+ + + + +
+
+ +

+ + Program + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Program() +

+
+ + + + + +
+

The main program node

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
errors + + + + Array.<Error> + + + + + + + + + + + + +
comments + + + + Array.<Doc> + + + + + + + + + + + <nullable>
+ +
+ +
tokens + + + + Array.<String> + + + + + + + + + + + <nullable>
+ +
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Property.html b/Property.html new file mode 100644 index 000000000..3c88eaa8f --- /dev/null +++ b/Property.html @@ -0,0 +1,735 @@ + + + + + + + + + Property - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Property +

+ + + + +
+
+ +

+ + Property + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Property() +

+
+ + + + + +
+

Defines a class property

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
isFinal + + + + boolean + + + + + + + + +
isStatic + + + + boolean + + + + + + + + +
visibility + + + + string + + + + + + + + +
value + + + + Node + + + | + + + null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/PropertyLookup.html b/PropertyLookup.html new file mode 100644 index 000000000..1f5e4f953 --- /dev/null +++ b/PropertyLookup.html @@ -0,0 +1,429 @@ + + + + + + + + + PropertyLookup - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ PropertyLookup +

+ + + + +
+
+ +

+ + PropertyLookup + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new PropertyLookup() +

+
+ + + + + +
+

Lookup to an object property

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 103fccc05..000000000 --- a/README.md +++ /dev/null @@ -1,122 +0,0 @@ -

php-parser

-

- -Coverage Status - - - - -

-

This javascript library parses PHP code and convert it to AST.

- -Installation ------------- - -This library is distributed with [npm](https://www.npmjs.com/package/php-parser) : - -```sh -npm install php-parser --save -``` - -Usage ------ - -```js -// initialize the php parser factory class -var fs = require('fs'); -var path = require('path'); -var engine = require('php-parser'); - -// initialize a new parser instance -var parser = new engine({ - // some options : - parser: { - extractDoc: true, - php7: true - }, - ast: { - withPositions: true - } -}); - -// Retrieve the AST from the specified source -var eval = parser.parseEval('echo "Hello World";'); - -// Retrieve an array of tokens (same as php function token_get_all) -var tokens = parser.tokenGetAll(' You can add here your own project by opening an issue request. - -## License - -This library is released under BSD-3 license clause. - -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fglayzzle%2Fphp-parser.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fglayzzle%2Fphp-parser?ref=badge_large) diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 1d53d32db..000000000 --- a/RELEASE.md +++ /dev/null @@ -1,101 +0,0 @@ -# Releases - -## 3.0.0-alpha3 : (2018-08-15) - - fix #168 : End location of `if` without semicolon - - impl #147 : Node informations about Binary and unicode strings - - impl #83 : Adding full support for PHP 7.2 - - fix #122 : Detect foreach bad syntax - - impl #152 : Improve tests with JEST - - fix #164 : Fixing some location issues (partial) - -## 3.0.0-alpha2 : (2018-04-14) - - fix #137 : Bug with parsing `list` - - fix #149 : Binary cast: isDoubleQuote incorrect - - fix #150 : strange ast with list - - fix #151 : Declare inside if - -## 3.0.0-alpha1 : (2018-04-11) - - https://github.com/glayzzle/php-parser/milestone/10 - - many fixes - - changed the way comments are handled - - add a new `raw` property on some nodes - -## 2.2.0 : (2017-12-27) -- Impl #108 : add an option to disable PHP7 support -- Fix #107 : fix T_DOUBLE_COLON handler -- Fix #106 : infinite loops from lexer (unput) -- Fix #105 : T_DOLLAR_OPEN_CURLY_BRACES handles now expressions -- PR #102 : Normalize the way type casts are defined -- Fix #103 : Fix critical cast to null confusion - -## 2.1.0 : (2017-11-01) -- Impl #91 & #92 : Functions support reserved names (PHP7) -- Fix #89 : parsing methods can use Buffers or Strings - -## 2.0.7 : (2017-09-03) -- Fix #86 : bug on Object properties usage in PHP like `__proto__`, or `constructor` -- Fix #84 : remove null statements from bodies - -## 2.0.6 : (2017-07-16) - -- Fix precedence between bin, retif, unary -- Fix precedence with assign - -## 2.0.4 : (2017-07-09) - -- Fix AST errors on suppressErrors -- Add curly boolean on variable node (for `${bar}` syntax) -- Implement the static closure flag, ex: `$c = static function() {};` - -## 2.0.0 : (2017-03-04) - -- Update AST for operators, unify bin/bool/coalesce nodes -- Fix nested block usage on function bodies -- Avoid initial $ on variables -- Shell nodes are now exposed by encapsed nodes only -- Typescript definition file -- Avoid identifier nodes on namespaces & use statements -- Fix precedence on bin, unary, retif nodes -- Fix ending position on functions/methods/closures -- Fix lexer unput at the end of the file (infinite loops) -- Add encapsed node (type=offset) on dynamic offsets -- Implement annonymous class arguments -- Fix missing first char on encapsed T_STRING_VARNAME - -## 1.0.0 : (2017-01-03) - -- All nodes are now converted to objects -- Bruteforce tests are in a separate project -- Improved tests with mocha -- Many syntax fixes -- Tests over a silent error mode -- Release of a complete AST documentation - -## 0.1.5 : (2016-12-27) - -> The 0.1.x version starts to be deprecated - -- Fix closure use token -- Improve silent errors handler -- Pass PHP7 tests -- Update class, traits, interface declarations -- Many syntax fixes - -## 0.1.4 : (2016-12-12) - -- Move from static instances to instanciated objects in order to fully handle -promises -- Fix the silentLexer -- Fix the debug output mode -- Add positions on `expr->set` - -## Older releases - -* 0.1.3 : add comments nodes, add a browser version and improved parser stability -* 0.1.0 : major release, rewriting of the lexer and many bug fixes -* 0.0.10 : bugfixes and php7 implementation -* 0.0.9 : const (value as expr) bugfix -* 0.0.8 : all tokens are passed on ZF2 (many fixes) -* 0.0.7 : isset, unset, try, catch, finally, fix T_STATIC, fix T_NEW with a dynamic var name, improve tests -* 0.0.6 : Improve tests, implements arrays & new statements -* 0.0.5 : Implement traits diff --git a/RetIf.html b/RetIf.html new file mode 100644 index 000000000..4858687a3 --- /dev/null +++ b/RetIf.html @@ -0,0 +1,545 @@ + + + + + + + + + RetIf - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ RetIf +

+ + + + +
+
+ +

+ + RetIf + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new RetIf() +

+
+ + + + + +
+

Defines a short if statement that returns a value

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
test + + + + Expression + + + + + + + + +
trueExpr + + + + Expression + + + + + + + + +
falseExpr + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Return.html b/Return.html new file mode 100644 index 000000000..1862035d8 --- /dev/null +++ b/Return.html @@ -0,0 +1,493 @@ + + + + + + + + + Return - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Return +

+ + + + +
+
+ +

+ + Return + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Return() +

+
+ + + + + +
+

A continue statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
expr + + + + Expression + + + | + + + null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Silent.html b/Silent.html new file mode 100644 index 000000000..65a042b7c --- /dev/null +++ b/Silent.html @@ -0,0 +1,487 @@ + + + + + + + + + Silent - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Silent +

+ + + + +
+
+ +

+ + Silent + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Silent() +

+
+ + + + + +
+

Avoids to show/log warnings & notices from the inner expression

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
expr + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Statement.html b/Statement.html new file mode 100644 index 000000000..477b88957 --- /dev/null +++ b/Statement.html @@ -0,0 +1,429 @@ + + + + + + + + + Statement - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Statement +

+ + + + +
+
+ +

+ + Statement + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Statement() +

+
+ + + + + +
+

Any statement.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Static.html b/Static.html new file mode 100644 index 000000000..7a17d1a2b --- /dev/null +++ b/Static.html @@ -0,0 +1,493 @@ + + + + + + + + + Static - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Static +

+ + + + +
+
+ +

+ + Static + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Static() +

+
+ + + + + +
+

Declares a static variable into the current scope

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
items + + + + Array.<Variable> + + + | + + + Array.<Assign> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/StaticLookup.html b/StaticLookup.html new file mode 100644 index 000000000..291afbcb8 --- /dev/null +++ b/StaticLookup.html @@ -0,0 +1,429 @@ + + + + + + + + + StaticLookup - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ StaticLookup +

+ + + + +
+
+ +

+ + StaticLookup + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new StaticLookup() +

+
+ + + + + +
+

Lookup to a static property

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/String.html b/String.html new file mode 100644 index 000000000..4f6660572 --- /dev/null +++ b/String.html @@ -0,0 +1,945 @@ + + + + + + + + + String - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ String +

+ + + + +
+
+ +

+ + String + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new String() +

+
+ + + + + +
+

Defines a string (simple ou double quoted) - chars are already escaped

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
unicode + + + + boolean + + + + + + + + +
isDoubleQuote + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ +

+ + String + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new String() +

+
+ + + + + +
+

Defines a nowdoc string

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
label + + + + String + + + + + + + + +
raw + + + + String + + + + + + + + +
quote + + + + Boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Switch.html b/Switch.html new file mode 100644 index 000000000..09925746f --- /dev/null +++ b/Switch.html @@ -0,0 +1,545 @@ + + + + + + + + + Switch - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Switch +

+ + + + +
+
+ +

+ + Switch + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Switch() +

+
+ + + + + +
+

Defines a switch statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
test + + + + Expression + + + + + + + + +
body + + + + Block + + + + + + + + +
shortForm + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Sys.html b/Sys.html new file mode 100644 index 000000000..f8e806685 --- /dev/null +++ b/Sys.html @@ -0,0 +1,487 @@ + + + + + + + + + Sys - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Sys +

+ + + + +
+
+ +

+ + Sys + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Sys() +

+
+ + + + + +
+

Defines system based call

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + + + Array.<Node> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Throw.html b/Throw.html new file mode 100644 index 000000000..54c07eb84 --- /dev/null +++ b/Throw.html @@ -0,0 +1,487 @@ + + + + + + + + + Throw - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Throw +

+ + + + +
+
+ +

+ + Throw + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Throw() +

+
+ + + + + +
+

Defines a throw statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
what + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Trait.html b/Trait.html new file mode 100644 index 000000000..e2882c2e7 --- /dev/null +++ b/Trait.html @@ -0,0 +1,706 @@ + + + + + + + + + Trait - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Trait +

+ + + + +
+
+ +

+ + Trait + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Trait() +

+
+ + + + + +
+

A trait definition

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
extends + + + + Identifier + + + | + + + null + + + + + + + + +
implements + + + + Array.<Identifier> + + + + + + + + +
body + + + + Array.<Declaration> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseFlags(flags) → {void} +

+
+ + + + + +
+

Generic flags parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags + + + + Array.<Integer> + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/TraitAlias.html b/TraitAlias.html new file mode 100644 index 000000000..3b70dd3bd --- /dev/null +++ b/TraitAlias.html @@ -0,0 +1,592 @@ + + + + + + + + + TraitAlias - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ TraitAlias +

+ + + + +
+
+ +

+ + TraitAlias + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new TraitAlias() +

+
+ + + + + +
+

Defines a trait alias

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
trait + + + + Identifier + + + | + + + null + + + + + + + + +
method + + + + string + + + + + + + + +
as + + + + string + + + | + + + null + + + + + + + + +
visibility + + + + string + + + | + + + null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/TraitPrecedence.html b/TraitPrecedence.html new file mode 100644 index 000000000..73d79b0e6 --- /dev/null +++ b/TraitPrecedence.html @@ -0,0 +1,551 @@ + + + + + + + + + TraitPrecedence - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ TraitPrecedence +

+ + + + +
+
+ +

+ + TraitPrecedence + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new TraitPrecedence() +

+
+ + + + + +
+

Defines a trait alias

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
trait + + + + Identifier + + + | + + + null + + + + + + + + +
method + + + + string + + + + + + + + +
instead + + + + Array.<Identifier> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/TraitUse.html b/TraitUse.html new file mode 100644 index 000000000..4b4b362df --- /dev/null +++ b/TraitUse.html @@ -0,0 +1,522 @@ + + + + + + + + + TraitUse - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ TraitUse +

+ + + + +
+
+ +

+ + TraitUse + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new TraitUse() +

+
+ + + + + +
+

Defines a trait usage

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
traits + + + + Array.<Identifier> + + + + + + + + +
adaptations + + + + Array.<Node> + + + | + + + null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Try.html b/Try.html new file mode 100644 index 000000000..dc6713aa5 --- /dev/null +++ b/Try.html @@ -0,0 +1,545 @@ + + + + + + + + + Try - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Try +

+ + + + +
+
+ +

+ + Try + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Try() +

+
+ + + + + +
+

Defines a try statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + + + Block + + + + + + + + +
catches + + + + Array.<Catch> + + + + + + + + +
allways + + + + Block + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Unary.html b/Unary.html new file mode 100644 index 000000000..a68ae43c4 --- /dev/null +++ b/Unary.html @@ -0,0 +1,516 @@ + + + + + + + + + Unary - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Unary +

+ + + + +
+
+ +

+ + Unary + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Unary() +

+
+ + + + + +
+

Unary operations

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + + + String + + + + + + + + +
what + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Unset.html b/Unset.html new file mode 100644 index 000000000..fc83ab252 --- /dev/null +++ b/Unset.html @@ -0,0 +1,429 @@ + + + + + + + + + Unset - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Unset +

+ + + + +
+
+ +

+ + Unset + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Unset() +

+
+ + + + + +
+

Deletes references to a list of variables

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/UseGroup.html b/UseGroup.html new file mode 100644 index 000000000..ba0dd95f3 --- /dev/null +++ b/UseGroup.html @@ -0,0 +1,572 @@ + + + + + + + + + UseGroup - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ UseGroup +

+ + + + +
+
+ +

+ + UseGroup + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new UseGroup() +

+
+ + + + + +
+

Defines a use statement (with a list of use items)

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + + + String + + + | + + + null + + + + + + + + +
type + + + + String + + + | + + + null + + + + + + + +

Possible value : function, const

+
item + + + + Array.<UseItem> + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/UseItem.html b/UseItem.html new file mode 100644 index 000000000..54f4a2f5d --- /dev/null +++ b/UseItem.html @@ -0,0 +1,572 @@ + + + + + + + + + UseItem - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ UseItem +

+ + + + +
+
+ +

+ + UseItem + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new UseItem() +

+
+ + + + + +
+

Defines a use statement (from namespace)

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + + + String + + + + + + + + +
type + + + + String + + + | + + + null + + + + + + + +

Possible value : function, const

+
alias + + + + String + + + | + + + null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Variable.html b/Variable.html new file mode 100644 index 000000000..5b25d3256 --- /dev/null +++ b/Variable.html @@ -0,0 +1,566 @@ + + + + + + + + + Variable - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Variable +

+ + + + +
+
+ +

+ + Variable + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Variable() +

+
+ + + + + +
+

Any expression node. Since the left-hand side of an assignment may +be any expression in general, an expression can also be a pattern.

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + + + String + + + | + + + Node + + + + + + + +

The variable name (can be a complex expression when the name is resolved dynamically)

+
byref + + + + boolean + + + + + + + +

Indicate if the variable reference is used, ex &$foo

+
curly + + + + boolean + + + + + + + +

Indicate if the name is defined between curlies, ex ${foo}

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
Example
+ + +
// PHP code :
&$foo
// AST output
{
 "kind": "variable",
 "name": "foo",
 "byref": true,
 "curly": false
}
+ + +
+ + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/While.html b/While.html new file mode 100644 index 000000000..d6cb56c3d --- /dev/null +++ b/While.html @@ -0,0 +1,545 @@ + + + + + + + + + While - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ While +

+ + + + +
+
+ +

+ + While + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new While() +

+
+ + + + + +
+

Defines a while statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
test + + + + Expression + + + + + + + + +
body + + + + Statement + + + + + + + + +
shortForm + + + + boolean + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/Yield.html b/Yield.html new file mode 100644 index 000000000..c9a070955 --- /dev/null +++ b/Yield.html @@ -0,0 +1,539 @@ + + + + + + + + + Yield - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Yield +

+ + + + +
+
+ +

+ + Yield + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new Yield() +

+
+ + + + + +
+

Defines a yield generator statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + + + Expression + + + | + + + Null + + + + + + + + +
key + + + + Expression + + + | + + + Null + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/YieldFrom.html b/YieldFrom.html new file mode 100644 index 000000000..8a82bdd9c --- /dev/null +++ b/YieldFrom.html @@ -0,0 +1,498 @@ + + + + + + + + + YieldFrom - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ YieldFrom +

+ + + + +
+
+ +

+ + YieldFrom + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new YieldFrom() +

+
+ + + + + +
+

Defines a yield from generator statement

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/ast.js.html b/ast.js.html new file mode 100644 index 000000000..c13634c60 --- /dev/null +++ b/ast.js.html @@ -0,0 +1,531 @@ + + + + + + + + + + + ast.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Location = require("./ast/location");
+const Position = require("./ast/position");
+
+/**
+ * ## Class hierarchy
+ *
+ * - [Location](#location)
+ * - [Position](#position)
+ * - [Node](#node)
+ *   - [Identifier](#identifier)
+ *   - [TraitUse](#traituse)
+ *   - [TraitAlias](#traitalias)
+ *   - [TraitPrecedence](#traitprecedence)
+ *   - [Entry](#entry)
+ *   - [Case](#case)
+ *   - [Label](#label)
+ *   - [Comment](#comment)
+ *     - [CommentLine](#commentline)
+ *     - [CommentBlock](#commentblock)
+ *   - [Error](#error)
+ *   - [Expression](#expression)
+ *     - [Array](#array)
+ *     - [Variable](#variable)
+ *     - [Variadic](#variadic)
+ *     - [ConstRef](#constref)
+ *     - [Yield](#yield)
+ *     - [YieldFrom](#yieldfrom)
+ *     - [Lookup](#lookup)
+ *       - [PropertyLookup](#propertylookup)
+ *       - [StaticLookup](#staticlookup)
+ *       - [OffsetLookup](#offsetlookup)
+ *     - [Operation](#operation)
+ *       - [Pre](#pre)
+ *       - [Post](#post)
+ *       - [Bin](#bin)
+ *       - [Unary](#unary)
+ *       - [Cast](#cast)
+ *     - [Literal](#literal)
+ *       - [Boolean](#boolean)
+ *       - [String](#string)
+ *       - [Number](#number)
+ *       - [Inline](#inline)
+ *       - [Magic](#magic)
+ *       - [Nowdoc](#nowdoc)
+ *       - [Encapsed](#encapsed)
+ *   - [Statement](#statement)
+ *     - [Eval](#eval)
+ *     - [Exit](#exit)
+ *     - [Halt](#halt)
+ *     - [Clone](#clone)
+ *     - [Declare](#declare)
+ *     - [Global](#global)
+ *     - [Static](#static)
+ *     - [Include](#include)
+ *     - [Assign](#assign)
+ *     - [RetIf](#retif)
+ *     - [If](#if)
+ *     - [Do](#do)
+ *     - [While](#while)
+ *     - [For](#for)
+ *     - [Foreach](#foreach)
+ *     - [Switch](#switch)
+ *     - [Goto](#goto)
+ *     - [Silent](#silent)
+ *     - [Try](#try)
+ *     - [Catch](#catch)
+ *     - [Throw](#throw)
+ *     - [Call](#call)
+ *     - [Closure](#closure)
+ *     - [New](#new)
+ *     - [UseGroup](#usegroup)
+ *     - [UseItem](#useitem)
+ *     - [Block](#block)
+ *       - [Program](#program)
+ *       - [Namespace](#namespace)
+ *     - [Sys](#sys)
+ *       - [Echo](#echo)
+ *       - [List](#list)
+ *       - [Print](#print)
+ *       - [Isset](#isset)
+ *       - [Unset](#unset)
+ *       - [Empty](#empty)
+ *     - [Declaration](#declaration)
+ *       - [Class](#class)
+ *       - [Interface](#interface)
+ *       - [Trait](#trait)
+ *       - [Constant](#constant)
+ *         - [ClassConstant](#classconstant)
+ *       - [Function](#function)
+ *         - [Method](#method)
+ *       - [Parameter](#parameter)
+ *       - [Property](#property)
+ * ---
+ */
+
+/**
+ * The AST builder class
+ * @constructor AST
+ * @tutorial AST
+ * @property {Boolean} withPositions - Should locate any node (by default false)
+ * @property {Boolean} withSource - Should extract the node original code (by default false)
+ */
+const AST = function(withPositions, withSource) {
+  this.withPositions = withPositions;
+  this.withSource = withSource;
+};
+
+/**
+ * Create a position node from specified parser
+ * including it's lexer current state
+ * @param {Parser}
+ * @return {Position}
+ * @private
+ */
+AST.prototype.position = function(parser) {
+  return new Position(
+    parser.lexer.yylloc.first_line,
+    parser.lexer.yylloc.first_column,
+    parser.lexer.yylloc.first_offset
+  );
+};
+
+// operators in ascending order of precedence
+AST.precedence = {};
+[
+  ["or"],
+  ["xor"],
+  ["and"],
+  ["="],
+  ["?"],
+  ["??"],
+  ["||"],
+  ["&&"],
+  ["|"],
+  ["^"],
+  ["&"],
+  ["==", "!=", "===", "!==", /* '<>', */ "<=>"],
+  ["<", "<=", ">", ">="],
+  ["<<", ">>"],
+  ["+", "-", "."],
+  ["*", "/", "%"],
+  ["!"],
+  ["instanceof"]
+  // TODO: typecasts
+  // TODO: [ (array)
+  // TODO: clone, new
+].forEach(function(list, index) {
+  list.forEach(function(operator) {
+    AST.precedence[operator] = index + 1;
+  });
+});
+
+/**
+ * Check and fix precence, by default using right
+ */
+AST.prototype.resolvePrecedence = function(result) {
+  let buffer, lLevel, rLevel;
+  // handling precendence
+  if (result.kind === "bin") {
+    if (result.right && !result.right.parenthesizedExpression) {
+      if (result.right.kind === "bin") {
+        lLevel = AST.precedence[result.type];
+        rLevel = AST.precedence[result.right.type];
+        if (lLevel && rLevel && rLevel <= lLevel) {
+          // https://github.com/glayzzle/php-parser/issues/79
+          // shift precedence
+          buffer = result.right;
+          result.right = result.right.left;
+          buffer.left = this.resolvePrecedence(result);
+          result = buffer;
+        }
+      } else if (result.right.kind === "retif") {
+        lLevel = AST.precedence[result.type];
+        rLevel = AST.precedence["?"];
+        if (lLevel && rLevel && rLevel <= lLevel) {
+          buffer = result.right;
+          result.right = result.right.test;
+          buffer.test = this.resolvePrecedence(result);
+          result = buffer;
+        }
+      }
+    }
+  } else if (result.kind === "unary") {
+    // https://github.com/glayzzle/php-parser/issues/75
+    if (result.what && !result.what.parenthesizedExpression) {
+      // unary precedence is allways lower
+      if (result.what.kind === "bin") {
+        buffer = result.what;
+        result.what = result.what.left;
+        buffer.left = this.resolvePrecedence(result);
+        result = buffer;
+      } else if (result.what.kind === "retif") {
+        buffer = result.what;
+        result.what = result.what.test;
+        buffer.test = this.resolvePrecedence(result);
+        result = buffer;
+      }
+    }
+  } else if (result.kind === "retif") {
+    // https://github.com/glayzzle/php-parser/issues/77
+    if (
+      result.falseExpr &&
+      result.falseExpr.kind === "retif" &&
+      !result.falseExpr.parenthesizedExpression
+    ) {
+      buffer = result.falseExpr;
+      result.falseExpr = buffer.test;
+      buffer.test = this.resolvePrecedence(result);
+      result = buffer;
+    }
+  } else if (result.kind === "assign") {
+    // https://github.com/glayzzle/php-parser/issues/81
+    if (
+      result.right &&
+      result.right.kind === "bin" &&
+      !result.right.parenthesizedExpression
+    ) {
+      lLevel = AST.precedence["="];
+      rLevel = AST.precedence[result.right.type];
+      // only shifts with and, xor, or
+      if (lLevel && rLevel && rLevel < lLevel) {
+        buffer = result.right;
+        result.right = result.right.left;
+        buffer.left = result;
+        result = buffer;
+      }
+    }
+  }
+  return result;
+};
+
+/**
+ * Prepares an AST node
+ * @param {String|null} kind - Defines the node type
+ * (if null, the kind must be passed at the function call)
+ * @param {Parser} parser - The parser instance (use for extracting locations)
+ * @return {Function}
+ */
+AST.prototype.prepare = function(kind, docs, parser) {
+  let start = null;
+  if (this.withPositions || this.withSource) {
+    start = this.position(parser);
+  }
+  const self = this;
+  // returns the node
+  const result = function() {
+    let location = null;
+    const args = Array.prototype.slice.call(arguments);
+    args.push(docs);
+    if (self.withPositions || self.withSource) {
+      let src = null;
+      if (self.withSource) {
+        src = parser.lexer._input.substring(start.offset, parser.prev[2]);
+      }
+      if (self.withPositions) {
+        location = new Location(
+          src,
+          start,
+          new Position(parser.prev[0], parser.prev[1], parser.prev[2])
+        );
+      } else {
+        location = new Location(src, null, null);
+      }
+      // last argument is allways the location
+      args.push(location);
+    }
+    // handle lazy kind definitions
+    if (!kind) {
+      kind = args.shift();
+    }
+    // build the object
+    const node = self[kind];
+    if (typeof node !== "function") {
+      throw new Error('Undefined node "' + kind + '"');
+    }
+    const result = Object.create(node.prototype);
+    node.apply(result, args);
+    return self.resolvePrecedence(result);
+  };
+  /**
+   * Helper to change a node kind
+   * @param {String} newKind
+   */
+  result.setKind = function(newKind) {
+    kind = newKind;
+  };
+  return result;
+};
+
+// Define all AST nodes
+[
+  require("./ast/array"),
+  require("./ast/assign"),
+  require("./ast/bin"),
+  require("./ast/block"),
+  require("./ast/boolean"),
+  require("./ast/break"),
+  require("./ast/call"),
+  require("./ast/case"),
+  require("./ast/cast"),
+  require("./ast/catch"),
+  require("./ast/class"),
+  require("./ast/classconstant"),
+  require("./ast/clone"),
+  require("./ast/closure"),
+  require("./ast/comment"),
+  require("./ast/commentblock"),
+  require("./ast/commentline"),
+  require("./ast/constant"),
+  require("./ast/constref"),
+  require("./ast/continue"),
+  require("./ast/declaration"),
+  require("./ast/declare"),
+  require("./ast/do"),
+  require("./ast/echo"),
+  require("./ast/empty"),
+  require("./ast/encapsed"),
+  require("./ast/entry"),
+  require("./ast/error"),
+  require("./ast/eval"),
+  require("./ast/exit"),
+  require("./ast/expression"),
+  require("./ast/for"),
+  require("./ast/foreach"),
+  require("./ast/function"),
+  require("./ast/global"),
+  require("./ast/goto"),
+  require("./ast/halt"),
+  require("./ast/identifier"),
+  require("./ast/if"),
+  require("./ast/include"),
+  require("./ast/inline"),
+  require("./ast/interface"),
+  require("./ast/isset"),
+  require("./ast/label"),
+  require("./ast/list"),
+  require("./ast/literal"),
+  require("./ast/lookup"),
+  require("./ast/magic"),
+  require("./ast/method"),
+  require("./ast/namespace"),
+  require("./ast/new"),
+  require("./ast/node"),
+  require("./ast/nowdoc"),
+  require("./ast/number"),
+  require("./ast/offsetlookup"),
+  require("./ast/operation"),
+  require("./ast/parameter"),
+  require("./ast/post"),
+  require("./ast/pre"),
+  require("./ast/print"),
+  require("./ast/program"),
+  require("./ast/property"),
+  require("./ast/propertylookup"),
+  require("./ast/retif"),
+  require("./ast/return"),
+  require("./ast/silent"),
+  require("./ast/statement"),
+  require("./ast/static"),
+  require("./ast/staticlookup"),
+  require("./ast/string"),
+  require("./ast/switch"),
+  require("./ast/sys"),
+  require("./ast/throw"),
+  require("./ast/trait"),
+  require("./ast/traitalias"),
+  require("./ast/traitprecedence"),
+  require("./ast/traituse"),
+  require("./ast/try"),
+  require("./ast/unary"),
+  require("./ast/unset"),
+  require("./ast/usegroup"),
+  require("./ast/useitem"),
+  require("./ast/variable"),
+  require("./ast/variadic"),
+  require("./ast/while"),
+  require("./ast/yield"),
+  require("./ast/yieldfrom")
+].forEach(function(ctor) {
+  let kind = ctor.prototype.constructor.name.toLowerCase();
+  if (kind[0] === "_") kind = kind.substring(1);
+  AST.prototype[kind] = ctor;
+});
+
+module.exports = AST;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_array.js.html b/ast_array.js.html new file mode 100644 index 000000000..d65cc48e2 --- /dev/null +++ b/ast_array.js.html @@ -0,0 +1,181 @@ + + + + + + + + + + + ast/array.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/array.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Expr = require("./expression");
+const KIND = "array";
+
+/**
+ * Defines an array structure
+ * @constructor Array
+ * @example
+ * // PHP code :
+ * [1, 'foo' => 'bar', 3]
+ *
+ * // AST structure :
+ * {
+ *  "kind": "array",
+ *  "shortForm": true
+ *  "items": [
+ *    {"kind": "number", "value": "1"},
+ *    {
+ *      "kind": "entry",
+ *      "key": {"kind": "string", "value": "foo", "isDoubleQuote": false},
+ *      "value": {"kind": "string", "value": "bar", "isDoubleQuote": false}
+ *    },
+ *    {"kind": "number", "value": "3"}
+ *  ]
+ * }
+ * @extends {Expression}
+ * @property {Entry|Expr|Variable} items List of array items
+ * @property {boolean} shortForm Indicate if the short array syntax is used, ex `[]` instead `array()`
+ */
+const Array = Expr.extends(function Array(shortForm, items, docs, location) {
+  Expr.apply(this, [KIND, docs, location]);
+  this.items = items;
+  this.shortForm = shortForm;
+});
+
+module.exports = Array;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_assign.js.html b/ast_assign.js.html new file mode 100644 index 000000000..43274c5a8 --- /dev/null +++ b/ast_assign.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/assign.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/assign.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "assign";
+
+/**
+ * Assigns a value to the specified target
+ * @constructor Assign
+ * @extends {Statement}
+ * @property {Expression} left
+ * @property {Expression} right
+ * @property {String} operator
+ */
+const Assign = Statement.extends(function Assign(
+  left,
+  right,
+  operator,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.operator = operator;
+  this.left = left;
+  this.right = right;
+});
+
+module.exports = Assign;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_bin.js.html b/ast_bin.js.html new file mode 100644 index 000000000..8cd593074 --- /dev/null +++ b/ast_bin.js.html @@ -0,0 +1,164 @@ + + + + + + + + + + + ast/bin.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/bin.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Operation = require("./operation");
+const KIND = "bin";
+/**
+ * Binary operations
+ * @constructor Bin
+ * @extends {Operation}
+ * @property {String} type
+ * @property {Expression} left
+ * @property {Expression} right
+ */
+const Bin = Operation.extends(function Bin(type, left, right, docs, location) {
+  Operation.apply(this, [KIND, docs, location]);
+  this.type = type;
+  this.left = left;
+  this.right = right;
+});
+
+module.exports = Bin;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_block.js.html b/ast_block.js.html new file mode 100644 index 000000000..a327fb11f --- /dev/null +++ b/ast_block.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/block.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/block.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "block";
+
+/**
+ * A block statement, i.e., a sequence of statements surrounded by braces.
+ * @constructor Block
+ * @extends {Statement}
+ * @property {Node[]} children
+ */
+const Block = Statement.extends(function Block(kind, children, docs, location) {
+  Statement.apply(this, [kind || KIND, docs, location]);
+  this.children = children.filter(Boolean);
+});
+
+module.exports = Block;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_boolean.js.html b/ast_boolean.js.html new file mode 100644 index 000000000..a9c82679b --- /dev/null +++ b/ast_boolean.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/boolean.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/boolean.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Literal = require("./literal");
+const KIND = "boolean";
+
+/**
+ * Defines a boolean value (true/false)
+ * @constructor Boolean
+ * @extends {Literal}
+ */
+const Boolean = Literal.extends(function Boolean(value, raw, docs, location) {
+  Literal.apply(this, [KIND, value, raw, docs, location]);
+});
+
+module.exports = Boolean;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_break.js.html b/ast_break.js.html new file mode 100644 index 000000000..6582b6fa9 --- /dev/null +++ b/ast_break.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/break.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/break.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "break";
+
+/**
+ * A break statement
+ * @constructor Break
+ * @extends {Node}
+ * @property {Number|Null} level
+ */
+const Break = Node.extends(function Break(level, docs, location) {
+  Node.apply(this, [KIND, docs, location]);
+  this.level = level;
+});
+
+module.exports = Break;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_call.js.html b/ast_call.js.html new file mode 100644 index 000000000..00d84bc04 --- /dev/null +++ b/ast_call.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/call.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/call.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "call";
+
+/**
+ * Executes a call statement
+ * @constructor Call
+ * @extends {Statement}
+ * @property {Identifier|Variable|??} what
+ * @property {Arguments[]} arguments
+ */
+const Call = Statement.extends(function Call(what, args, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.what = what;
+  this.arguments = args;
+});
+
+module.exports = Call;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_case.js.html b/ast_case.js.html new file mode 100644 index 000000000..7ac1ded7f --- /dev/null +++ b/ast_case.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/case.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/case.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "case";
+
+/**
+ * A switch case statement
+ * @constructor Case
+ * @extends {Node}
+ * @property {Expression|null} test - if null, means that the default case
+ * @property {Block|null} body
+ */
+const Case = Node.extends(function Case(test, body, docs, location) {
+  Node.apply(this, [KIND, docs, location]);
+  this.test = test;
+  this.body = body;
+});
+
+module.exports = Case;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_cast.js.html b/ast_cast.js.html new file mode 100644 index 000000000..677a25cfc --- /dev/null +++ b/ast_cast.js.html @@ -0,0 +1,165 @@ + + + + + + + + + + + ast/cast.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/cast.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Operation = require("./operation");
+const KIND = "cast";
+
+/**
+ * Binary operations
+ * @constructor Cast
+ * @extends {Operation}
+ * @property {String} type
+ * @property {String} raw
+ * @property {Expression} what
+ */
+const Cast = Operation.extends(function Cast(type, raw, what, docs, location) {
+  Operation.apply(this, [KIND, docs, location]);
+  this.type = type;
+  this.raw = raw;
+  this.what = what;
+});
+
+module.exports = Cast;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_catch.js.html b/ast_catch.js.html new file mode 100644 index 000000000..63f874b9e --- /dev/null +++ b/ast_catch.js.html @@ -0,0 +1,172 @@ + + + + + + + + + + + ast/catch.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/catch.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "catch";
+
+/**
+ * Defines a catch statement
+ * @constructor Catch
+ * @extends {Statement}
+ * @property {Identifier[]} what
+ * @property {Variable} variable
+ * @property {Statement} body
+ * @see http://php.net/manual/en/language.exceptions.php
+ */
+const Catch = Statement.extends(function Catch(
+  body,
+  what,
+  variable,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.body = body;
+  this.what = what;
+  this.variable = variable;
+});
+
+module.exports = Catch;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_class.js.html b/ast_class.js.html new file mode 100644 index 000000000..6cdb4c9d3 --- /dev/null +++ b/ast_class.js.html @@ -0,0 +1,178 @@ + + + + + + + + + + + ast/class.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/class.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Declaration = require("./declaration");
+const KIND = "class";
+
+/**
+ * A class definition
+ * @constructor Class
+ * @extends {Declaration}
+ * @property {Identifier|null} extends
+ * @property {Identifier[]} implements
+ * @property {Declaration[]} body
+ * @property {boolean} isAnonymous
+ * @property {boolean} isAbstract
+ * @property {boolean} isFinal
+ */
+const Class = Declaration.extends(function Class(
+  name,
+  ext,
+  impl,
+  body,
+  flags,
+  docs,
+  location
+) {
+  Declaration.apply(this, [KIND, name, docs, location]);
+  this.isAnonymous = name ? false : true;
+  this.extends = ext;
+  this.implements = impl;
+  this.body = body;
+  this.parseFlags(flags);
+});
+
+module.exports = Class;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_classconstant.js.html b/ast_classconstant.js.html new file mode 100644 index 000000000..28e075294 --- /dev/null +++ b/ast_classconstant.js.html @@ -0,0 +1,169 @@ + + + + + + + + + + + ast/classconstant.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/classconstant.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Constant = require("./constant");
+const KIND = "classconstant";
+
+/**
+ * Defines a class/interface/trait constant
+ * @constructor ClassConstant
+ * @extends {Constant}
+ * @property {boolean} isStatic
+ * @property {string} visibility
+ */
+const ClassConstant = Constant.extends(function ClassConstant(
+  name,
+  value,
+  flags,
+  docs,
+  location
+) {
+  Constant.apply(this, [name, value, docs, location]);
+  this.kind = KIND;
+  this.parseFlags(flags);
+});
+
+module.exports = ClassConstant;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_clone.js.html b/ast_clone.js.html new file mode 100644 index 000000000..a83f9f96f --- /dev/null +++ b/ast_clone.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/clone.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/clone.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "clone";
+
+/**
+ * Defines a clone call
+ * @constructor Clone
+ * @extends {Statement}
+ * @property {Expression} what
+ */
+const Clone = Statement.extends(function Clone(what, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.what = what;
+});
+
+module.exports = Clone;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_closure.js.html b/ast_closure.js.html new file mode 100644 index 000000000..576cafc26 --- /dev/null +++ b/ast_closure.js.html @@ -0,0 +1,182 @@ + + + + + + + + + + + ast/closure.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/closure.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "closure";
+
+/**
+ * Defines a closure
+ * @constructor Closure
+ * @extends {Statement}
+ * @property {Parameter[]} arguments
+ * @property {Variable[]} uses
+ * @property {Identifier} type
+ * @property {boolean} byref
+ * @property {boolean} nullable
+ * @property {Block|null} body
+ * @property {boolean} isStatic
+ */
+const Closure = Statement.extends(function Closure(
+  args,
+  byref,
+  uses,
+  type,
+  nullable,
+  isStatic,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.uses = uses;
+  this.arguments = args;
+  this.byref = byref;
+  this.type = type;
+  this.nullable = nullable;
+  this.isStatic = isStatic || false;
+  this.body = null;
+});
+
+module.exports = Closure;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_comment.js.html b/ast_comment.js.html new file mode 100644 index 000000000..e0b167320 --- /dev/null +++ b/ast_comment.js.html @@ -0,0 +1,160 @@ + + + + + + + + + + + ast/comment.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/comment.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+
+/**
+ * Abstract documentation node (ComentLine or CommentBlock)
+ * @constructor Comment
+ * @extends {Node}
+ * @property {String} value
+ */
+const Comment = Node.extends(function Comment(kind, value, docs, location) {
+  Node.apply(this, [kind, docs, location]);
+  this.value = value;
+});
+
+module.exports = Comment;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_commentblock.js.html b/ast_commentblock.js.html new file mode 100644 index 000000000..cb86b5d59 --- /dev/null +++ b/ast_commentblock.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/commentblock.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/commentblock.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Comment = require("./comment");
+const KIND = "commentblock";
+
+/**
+ * A comment block (multiline)
+ * @constructor CommentBlock
+ * @extends {Comment}
+ */
+const CommentBlock = Comment.extends(function CommentBlock(
+  value,
+  docs,
+  location
+) {
+  Comment.apply(this, [KIND, value, docs, location]);
+});
+
+module.exports = CommentBlock;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_commentline.js.html b/ast_commentline.js.html new file mode 100644 index 000000000..d6c520c5a --- /dev/null +++ b/ast_commentline.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/commentline.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/commentline.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Comment = require("./comment");
+const KIND = "commentline";
+
+/**
+ * A single line comment
+ * @constructor CommentLine
+ * @extends {Comment}
+ */
+const CommentLine = Comment.extends(function CommentLine(
+  value,
+  docs,
+  location
+) {
+  Comment.apply(this, [KIND, value, docs, location]);
+});
+
+module.exports = CommentLine;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_constant.js.html b/ast_constant.js.html new file mode 100644 index 000000000..e229d101d --- /dev/null +++ b/ast_constant.js.html @@ -0,0 +1,166 @@ + + + + + + + + + + + ast/constant.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/constant.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Declaration = require("./declaration");
+const KIND = "constant";
+
+/**
+ * Defines a namespace constant
+ * @constructor Constant
+ * @extends {Declaration}
+ * @property {Node|null} value
+ */
+const Constant = Declaration.extends(function Constant(
+  name,
+  value,
+  docs,
+  location
+) {
+  Declaration.apply(this, [KIND, name, docs, location]);
+  this.value = value;
+});
+
+module.exports = Constant;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_constref.js.html b/ast_constref.js.html new file mode 100644 index 000000000..b82e21860 --- /dev/null +++ b/ast_constref.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/constref.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/constref.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Expr = require("./expression");
+const KIND = "constref";
+
+/**
+ * A constant reference
+ * @constructor ConstRef
+ * @extends {Expression}
+ * @property {String|Node} name
+ */
+const ConstRef = Expr.extends(function ConstRef(identifier, docs, location) {
+  Expr.apply(this, [KIND, docs, location]);
+  this.name = identifier;
+});
+
+module.exports = ConstRef;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_continue.js.html b/ast_continue.js.html new file mode 100644 index 000000000..97ae3a425 --- /dev/null +++ b/ast_continue.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/continue.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/continue.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "continue";
+
+/**
+ * A continue statement
+ * @constructor Continue
+ * @extends {Node}
+ * @property {Number|Null} level
+ */
+const Continue = Node.extends(function Continue(level, docs, location) {
+  Node.apply(this, [KIND, docs, location]);
+  this.level = level;
+});
+
+module.exports = Continue;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_declaration.js.html b/ast_declaration.js.html new file mode 100644 index 000000000..696da4296 --- /dev/null +++ b/ast_declaration.js.html @@ -0,0 +1,193 @@ + + + + + + + + + + + ast/declaration.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/declaration.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "declaration";
+
+const IS_UNDEFINED = "";
+const IS_PUBLIC = "public";
+const IS_PROTECTED = "protected";
+const IS_PRIVATE = "private";
+
+/**
+ * A declaration statement (function, class, interface...)
+ * @constructor Declaration
+ * @extends {Statement}
+ * @property {string} name
+ */
+const Declaration = Statement.extends(function Declaration(
+  kind,
+  name,
+  docs,
+  location
+) {
+  Statement.apply(this, [kind || KIND, docs, location]);
+  this.name = name;
+});
+
+/**
+ * Generic flags parser
+ * @param {Integer[]} flags
+ * @return {void}
+ */
+Declaration.prototype.parseFlags = function(flags) {
+  this.isAbstract = flags[2] === 1;
+  this.isFinal = flags[2] === 2;
+  if (this.kind !== "class") {
+    if (flags[0] === -1) {
+      this.visibility = IS_UNDEFINED;
+    } else if (flags[0] === 0) {
+      this.visibility = IS_PUBLIC;
+    } else if (flags[0] === 1) {
+      this.visibility = IS_PROTECTED;
+    } else if (flags[0] === 2) {
+      this.visibility = IS_PRIVATE;
+    }
+    this.isStatic = flags[1] === 1;
+  }
+};
+
+module.exports = Declaration;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_declare.js.html b/ast_declare.js.html new file mode 100644 index 000000000..2773a1bc8 --- /dev/null +++ b/ast_declare.js.html @@ -0,0 +1,209 @@ + + + + + + + + + + + ast/declare.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/declare.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Block = require("./block");
+const KIND = "declare";
+
+/**
+ * The declare construct is used to set execution directives for a block of code
+ * @constructor Declare
+ * @extends {Block}
+ * @property {Expression[]} what
+ * @property {String} mode
+ * @see http://php.net/manual/en/control-structures.declare.php
+ */
+const Declare = Block.extends(function Declare(
+  what,
+  body,
+  mode,
+  docs,
+  location
+) {
+  Block.apply(this, [KIND, body, docs, location]);
+  this.what = what;
+  this.mode = mode;
+});
+
+/**
+ * The node is declared as a short tag syntax :
+ * ```php
+ * <?php
+ * declare(ticks=1):
+ * // some statements
+ * enddeclare;
+ * ```
+ * @constant {String} MODE_SHORT
+ */
+Declare.MODE_SHORT = "short";
+
+/**
+ * The node is declared bracket enclosed code :
+ * ```php
+ * <?php
+ * declare(ticks=1) {
+ * // some statements
+ * }
+ * ```
+ * @constant {String} MODE_BLOCK
+ */
+Declare.MODE_BLOCK = "block";
+
+/**
+ * The node is declared as a simple statement. In order to make things simpler
+ * children of the node are automatically collected until the next
+ * declare statement.
+ * ```php
+ * <?php
+ * declare(ticks=1);
+ * // some statements
+ * declare(ticks=2);
+ * // some statements
+ * ```
+ * @constant {String} MODE_NONE
+ */
+Declare.MODE_NONE = "none";
+
+module.exports = Declare;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_do.js.html b/ast_do.js.html new file mode 100644 index 000000000..e7748f940 --- /dev/null +++ b/ast_do.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/do.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/do.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "do";
+
+/**
+ * Defines a do/while statement
+ * @constructor Do
+ * @extends {Statement}
+ * @property {Expression} test
+ * @property {Statement} body
+ */
+const Do = Statement.extends(function Do(test, body, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.test = test;
+  this.body = body;
+});
+
+module.exports = Do;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_echo.js.html b/ast_echo.js.html new file mode 100644 index 000000000..354df8de2 --- /dev/null +++ b/ast_echo.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/echo.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/echo.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Sys = require("./sys");
+const KIND = "echo";
+
+/**
+ * Defines system based call
+ * @constructor Echo
+ * @property {boolean} shortForm
+ * @extends {Sys}
+ */
+const Echo = Sys.extends(function Echo(args, shortForm, docs, location) {
+  Sys.apply(this, [KIND, args, docs, location]);
+  this.shortForm = shortForm;
+});
+
+module.exports = Echo;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_empty.js.html b/ast_empty.js.html new file mode 100644 index 000000000..28daec1a2 --- /dev/null +++ b/ast_empty.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/empty.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/empty.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Sys = require("./sys");
+const KIND = "empty";
+
+/**
+ * Defines an empty check call
+ * @constructor Empty
+ * @extends {Sys}
+ */
+const Empty = Sys.extends(function Empty(args, docs, location) {
+  Sys.apply(this, [KIND, args, docs, location]);
+});
+
+module.exports = Empty;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_encapsed.js.html b/ast_encapsed.js.html new file mode 100644 index 000000000..f0ca07268 --- /dev/null +++ b/ast_encapsed.js.html @@ -0,0 +1,211 @@ + + + + + + + + + + + ast/encapsed.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/encapsed.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Literal = require("./literal");
+const KIND = "encapsed";
+
+/**
+ * Defines an encapsed string (contains expressions)
+ * @constructor Encapsed
+ * @extends {Literal}
+ * @property {String} type - Defines the type of encapsed string (shell, heredoc, string)
+ * @property {String|Null} label - The heredoc label, defined only when the type is heredoc
+ */
+const Encapsed = Literal.extends(function Encapsed(
+  value,
+  raw,
+  type,
+  docs,
+  location
+) {
+  Literal.apply(this, [KIND, value, raw, docs, location]);
+  this.type = type;
+});
+
+/**
+ * The node is a double quote string :
+ * ```php
+ * <?php
+ * echo "hello $world";
+ * ```
+ * @constant {String} TYPE_STRING - `string`
+ */
+Encapsed.TYPE_STRING = "string";
+
+/**
+ * The node is a shell execute string :
+ * ```php
+ * <?php
+ * echo `ls -larth $path`;
+ * ```
+ * @constant {String} TYPE_SHELL - `shell`
+ */
+Encapsed.TYPE_SHELL = "shell";
+
+/**
+ * The node is a shell execute string :
+ * ```php
+ * <?php
+ * echo <<<STR
+ *  Hello $world
+ * STR
+ * ;
+ * ```
+ * @constant {String} TYPE_HEREDOC - `heredoc`
+ */
+Encapsed.TYPE_HEREDOC = "heredoc";
+
+/**
+ * The node contains a list of constref / variables / expr :
+ * ```php
+ * <?php
+ * echo $foo->bar_$baz;
+ * ```
+ * @constant {String} TYPE_OFFSET - `offset`
+ */
+Encapsed.TYPE_OFFSET = "offset";
+
+module.exports = Encapsed;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_entry.js.html b/ast_entry.js.html new file mode 100644 index 000000000..65070259c --- /dev/null +++ b/ast_entry.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/entry.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/entry.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "entry";
+
+/**
+ * An array entry - see [Array](#array)
+ * @constructor Entry
+ * @extends {Node}
+ * @property {Node|null} key The entry key/offset
+ * @property {Node} value The entry value
+ */
+const Entry = Node.extends(function Entry(key, value, docs, location) {
+  Node.apply(this, [KIND, docs, location]);
+  this.key = key;
+  this.value = value;
+});
+
+module.exports = Entry;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_error.js.html b/ast_error.js.html new file mode 100644 index 000000000..81a7b1eba --- /dev/null +++ b/ast_error.js.html @@ -0,0 +1,174 @@ + + + + + + + + + + + ast/error.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/error.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "error";
+
+/**
+ * Defines an error node (used only on silentMode)
+ * @constructor Error
+ * @extends {Node}
+ * @property {string} message
+ * @property {number} line
+ * @property {number|string} token
+ * @property {string|array} expected
+ */
+const Error = Node.extends(function Error(
+  message,
+  token,
+  line,
+  expected,
+  docs,
+  location
+) {
+  Node.apply(this, [KIND, docs, location]);
+  this.message = message;
+  this.token = token;
+  this.line = line;
+  this.expected = expected;
+});
+
+module.exports = Error;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_eval.js.html b/ast_eval.js.html new file mode 100644 index 000000000..fe3db1647 --- /dev/null +++ b/ast_eval.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/eval.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/eval.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "eval";
+
+/**
+ * Defines an eval statement
+ * @constructor Eval
+ * @extends {Statement}
+ * @property {Node} source
+ */
+const Eval = Statement.extends(function Eval(source, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.source = source;
+});
+
+module.exports = Eval;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_exit.js.html b/ast_exit.js.html new file mode 100644 index 000000000..dc0e04251 --- /dev/null +++ b/ast_exit.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/exit.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/exit.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "exit";
+
+/**
+ * Defines an exit / die call
+ * @constructor Exit
+ * @extends {Statement}
+ * @property {Node|null} status
+ * @property {Boolean} useDie
+ */
+const Exit = Statement.extends(function Exit(status, useDie, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.status = status;
+  this.useDie = useDie;
+});
+
+module.exports = Exit;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_expression.js.html b/ast_expression.js.html new file mode 100644 index 000000000..90f5ed98f --- /dev/null +++ b/ast_expression.js.html @@ -0,0 +1,160 @@ + + + + + + + + + + + ast/expression.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/expression.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "expression";
+
+/**
+ * Any expression node. Since the left-hand side of an assignment may
+ * be any expression in general, an expression can also be a pattern.
+ * @constructor Expression
+ * @extends {Node}
+ */
+const Expression = Node.extends(function Expression(kind, docs, location) {
+  Node.apply(this, [kind || KIND, docs, location]);
+});
+
+module.exports = Expression;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_for.js.html b/ast_for.js.html new file mode 100644 index 000000000..8f121d00d --- /dev/null +++ b/ast_for.js.html @@ -0,0 +1,178 @@ + + + + + + + + + + + ast/for.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/for.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "for";
+
+/**
+ * Defines a for iterator
+ * @constructor For
+ * @extends {Statement}
+ * @property {Expression[]} init
+ * @property {Expression[]} test
+ * @property {Expression[]} increment
+ * @property {Statement} body
+ * @property {boolean} shortForm
+ * @see http://php.net/manual/en/control-structures.for.php
+ */
+const For = Statement.extends(function For(
+  init,
+  test,
+  increment,
+  body,
+  shortForm,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.init = init;
+  this.test = test;
+  this.increment = increment;
+  this.shortForm = shortForm;
+  this.body = body;
+});
+
+module.exports = For;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_foreach.js.html b/ast_foreach.js.html new file mode 100644 index 000000000..d85c51a77 --- /dev/null +++ b/ast_foreach.js.html @@ -0,0 +1,178 @@ + + + + + + + + + + + ast/foreach.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/foreach.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "foreach";
+
+/**
+ * Defines a foreach iterator
+ * @constructor Foreach
+ * @extends {Statement}
+ * @property {Expression} source
+ * @property {Expression|null} key
+ * @property {Expression} value
+ * @property {Statement} body
+ * @property {boolean} shortForm
+ * @see http://php.net/manual/en/control-structures.foreach.php
+ */
+const Foreach = Statement.extends(function Foreach(
+  source,
+  key,
+  value,
+  body,
+  shortForm,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.source = source;
+  this.key = key;
+  this.value = value;
+  this.shortForm = shortForm;
+  this.body = body;
+});
+
+module.exports = Foreach;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_function.js.html b/ast_function.js.html new file mode 100644 index 000000000..7d9ea5349 --- /dev/null +++ b/ast_function.js.html @@ -0,0 +1,176 @@ + + + + + + + + + + + ast/function.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/function.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Declaration = require("./declaration");
+const KIND = "function";
+
+/**
+ * Defines a classic function
+ * @constructor Function
+ * @extends {Declaration}
+ * @property {Parameter[]} arguments
+ * @property {Identifier} type
+ * @property {boolean} byref
+ * @property {boolean} nullable
+ * @property {Block|null} body
+ */
+const fn = Declaration.extends(function _Function(
+  name,
+  args,
+  byref,
+  type,
+  nullable,
+  docs,
+  location
+) {
+  Declaration.apply(this, [KIND, name, docs, location]);
+  this.arguments = args;
+  this.byref = byref;
+  this.type = type;
+  this.nullable = nullable;
+  this.body = null;
+});
+module.exports = fn;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_global.js.html b/ast_global.js.html new file mode 100644 index 000000000..9d97bdfce --- /dev/null +++ b/ast_global.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/global.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/global.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "global";
+
+/**
+ * Imports a variable from the global scope
+ * @constructor Global
+ * @extends {Statement}
+ * @property {Variable[]} items
+ */
+const Global = Statement.extends(function Global(items, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.items = items;
+});
+
+module.exports = Global;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_goto.js.html b/ast_goto.js.html new file mode 100644 index 000000000..0a8d03675 --- /dev/null +++ b/ast_goto.js.html @@ -0,0 +1,162 @@ + + + + + + + + + + + ast/goto.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/goto.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "goto";
+
+/**
+ * Defines goto statement
+ * @constructor Goto
+ * @extends {Statement}
+ * @property {String} label
+ * @see {Label}
+ */
+const Goto = Statement.extends(function Goto(label, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.label = label;
+});
+
+module.exports = Goto;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_halt.js.html b/ast_halt.js.html new file mode 100644 index 000000000..e6fb18cc8 --- /dev/null +++ b/ast_halt.js.html @@ -0,0 +1,162 @@ + + + + + + + + + + + ast/halt.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/halt.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "halt";
+
+/**
+ * Halts the compiler execution
+ * @constructor Halt
+ * @extends {Statement}
+ * @property {String} after - String after the halt statement
+ * @see http://php.net/manual/en/function.halt-compiler.php
+ */
+const Halt = Statement.extends(function Halt(after, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.after = after;
+});
+
+module.exports = Halt;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_identifier.js.html b/ast_identifier.js.html new file mode 100644 index 000000000..d5bf14b5a --- /dev/null +++ b/ast_identifier.js.html @@ -0,0 +1,199 @@ + + + + + + + + + + + ast/identifier.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/identifier.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "identifier";
+
+/**
+ * Defines an identifier node
+ * @constructor Identifier
+ * @extends {Node}
+ * @property {string} name
+ * @property {string} resolution
+ */
+const Identifier = Node.extends(function Identifier(
+  name,
+  isRelative,
+  docs,
+  location
+) {
+  Node.apply(this, [KIND, docs, location]);
+  if (isRelative) {
+    this.resolution = Identifier.RELATIVE_NAME;
+  } else if (name.length === 1) {
+    this.resolution = Identifier.UNQUALIFIED_NAME;
+  } else if (name[0] === "") {
+    this.resolution = Identifier.FULL_QUALIFIED_NAME;
+  } else {
+    this.resolution = Identifier.QUALIFIED_NAME;
+  }
+  this.name = name.join("\\");
+});
+
+/**
+ * This is an identifier without a namespace separator, such as Foo
+ * @constant {String} UNQUALIFIED_NAME
+ */
+Identifier.UNQUALIFIED_NAME = "uqn";
+/**
+ * This is an identifier with a namespace separator, such as Foo\Bar
+ * @constant {String} QUALIFIED_NAME
+ */
+Identifier.QUALIFIED_NAME = "qn";
+/**
+ * This is an identifier with a namespace separator that begins with
+ * a namespace separator, such as \Foo\Bar. The namespace \Foo is also
+ * a fully qualified name.
+ * @constant {String} FULL_QUALIFIED_NAME
+ */
+Identifier.FULL_QUALIFIED_NAME = "fqn";
+/**
+ * This is an identifier starting with namespace, such as namespace\Foo\Bar.
+ * @constant {String} RELATIVE_NAME
+ */
+Identifier.RELATIVE_NAME = "rn";
+
+module.exports = Identifier;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_if.js.html b/ast_if.js.html new file mode 100644 index 000000000..7ce15862b --- /dev/null +++ b/ast_if.js.html @@ -0,0 +1,174 @@ + + + + + + + + + + + ast/if.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/if.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "if";
+
+/**
+ * Defines a if statement
+ * @constructor If
+ * @extends {Statement}
+ * @property {Expression} test
+ * @property {Block} body
+ * @property {Block|If|null} alternate
+ * @property {boolean} shortForm
+ */
+const If = Statement.extends(function If(
+  test,
+  body,
+  alternate,
+  shortForm,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.test = test;
+  this.body = body;
+  this.alternate = alternate;
+  this.shortForm = shortForm;
+});
+
+module.exports = If;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_include.js.html b/ast_include.js.html new file mode 100644 index 000000000..ec282b434 --- /dev/null +++ b/ast_include.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/include.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/include.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "include";
+
+/**
+ * Defines system include call
+ * @constructor Include
+ * @extends {Statement}
+ * @property {Node} target
+ * @property {boolean} once
+ * @property {boolean} require
+ */
+const Include = Statement.extends(function Include(
+  once,
+  require,
+  target,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.once = once;
+  this.require = require;
+  this.target = target;
+});
+
+module.exports = Include;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_inline.js.html b/ast_inline.js.html new file mode 100644 index 000000000..294a2d15e --- /dev/null +++ b/ast_inline.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/inline.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/inline.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Literal = require("./literal");
+const KIND = "inline";
+
+/**
+ * Defines inline html output (treated as echo output)
+ * @constructor Inline
+ * @extends {Literal}
+ */
+const Inline = Literal.extends(function Inline(value, raw, docs, location) {
+  Literal.apply(this, [KIND, value, raw, docs, location]);
+});
+
+module.exports = Inline;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_interface.js.html b/ast_interface.js.html new file mode 100644 index 000000000..3c2c9a524 --- /dev/null +++ b/ast_interface.js.html @@ -0,0 +1,169 @@ + + + + + + + + + + + ast/interface.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/interface.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Declaration = require("./declaration");
+const KIND = "interface";
+
+/**
+ * An interface definition
+ * @constructor Interface
+ * @extends {Declaration}
+ * @property {Identifier[]} extends
+ * @property {Declaration[]} body
+ */
+const Interface = Declaration.extends(function Interface(
+  name,
+  ext,
+  body,
+  docs,
+  location
+) {
+  Declaration.apply(this, [KIND, name, docs, location]);
+  this.extends = ext;
+  this.body = body;
+});
+
+module.exports = Interface;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_isset.js.html b/ast_isset.js.html new file mode 100644 index 000000000..05706df0a --- /dev/null +++ b/ast_isset.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/isset.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/isset.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Sys = require("./sys");
+const KIND = "isset";
+
+/**
+ * Defines an isset call
+ * @constructor Isset
+ * @extends {Sys}
+ */
+const Isset = Sys.extends(function Isset(args, docs, location) {
+  Sys.apply(this, [KIND, args, docs, location]);
+});
+
+module.exports = Isset;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_label.js.html b/ast_label.js.html new file mode 100644 index 000000000..e62f9a210 --- /dev/null +++ b/ast_label.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/label.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/label.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "label";
+
+/**
+ * A label statement (referenced by goto)
+ * @constructor Label
+ * @extends {Node}
+ * @property {String} name
+ */
+const Label = Node.extends(function Label(name, docs, location) {
+  Node.apply(this, [KIND, docs, location]);
+  this.name = name;
+});
+
+module.exports = Label;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_list.js.html b/ast_list.js.html new file mode 100644 index 000000000..bde920e0c --- /dev/null +++ b/ast_list.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/list.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/list.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Sys = require("./sys");
+const KIND = "list";
+
+/**
+ * Defines list assignment
+ * @constructor List
+ * @extends {Sys}
+ * @property {boolean} shortForm
+ */
+const List = Sys.extends(function List(items, shortForm, docs, location) {
+  Sys.apply(this, [KIND, items, docs, location]);
+  this.shortForm = shortForm;
+});
+
+module.exports = List;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_literal.js.html b/ast_literal.js.html new file mode 100644 index 000000000..2bba79b0a --- /dev/null +++ b/ast_literal.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/literal.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/literal.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Expr = require("./expression");
+const KIND = "literal";
+
+/**
+ * Defines an array structure
+ * @constructor Literal
+ * @extends {Expression}
+ * @property {string} raw
+ * @property {Node|string|number|boolean|null} value
+ */
+const Literal = Expr.extends(function Literal(
+  kind,
+  value,
+  raw,
+  docs,
+  location
+) {
+  Expr.apply(this, [kind || KIND, docs, location]);
+  this.value = value;
+  if (raw) {
+    this.raw = raw;
+  }
+});
+
+module.exports = Literal;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_location.js.html b/ast_location.js.html new file mode 100644 index 000000000..df46e8eb6 --- /dev/null +++ b/ast_location.js.html @@ -0,0 +1,160 @@ + + + + + + + + + + + ast/location.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/location.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+/**
+ * Defines the location of the node (with it's source contents as string)
+ * @constructor Location
+ * @property {String|null} source
+ * @property {Position} start
+ * @property {Position} end
+ */
+const Location = function(source, start, end) {
+  this.source = source;
+  this.start = start;
+  this.end = end;
+};
+
+module.exports = Location;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_lookup.js.html b/ast_lookup.js.html new file mode 100644 index 000000000..bcb7524a9 --- /dev/null +++ b/ast_lookup.js.html @@ -0,0 +1,169 @@ + + + + + + + + + + + ast/lookup.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/lookup.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Expr = require("./expression");
+const KIND = "lookup";
+
+/**
+ * Lookup on an offset in the specified object
+ * @constructor Lookup
+ * @extends {Expression}
+ * @property {Expression} what
+ * @property {Expression} offset
+ */
+const Lookup = Expr.extends(function Lookup(
+  kind,
+  what,
+  offset,
+  docs,
+  location
+) {
+  Expr.apply(this, [kind || KIND, docs, location]);
+  this.what = what;
+  this.offset = offset;
+});
+
+module.exports = Lookup;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_magic.js.html b/ast_magic.js.html new file mode 100644 index 000000000..020d52e81 --- /dev/null +++ b/ast_magic.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/magic.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/magic.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Literal = require("./literal");
+const KIND = "magic";
+
+/**
+ * Defines magic constant
+ * @constructor Magic
+ * @extends {Literal}
+ */
+const Magic = Literal.extends(function Magic(value, raw, docs, location) {
+  Literal.apply(this, [KIND, value, raw, docs, location]);
+});
+
+module.exports = Magic;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_method.js.html b/ast_method.js.html new file mode 100644 index 000000000..c88bedf14 --- /dev/null +++ b/ast_method.js.html @@ -0,0 +1,164 @@ + + + + + + + + + + + ast/method.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/method.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const fn = require("./function");
+const KIND = "method";
+
+/**
+ * Defines a class/interface/trait method
+ * @constructor Method
+ * @extends {Function}
+ * @property {boolean} isAbstract
+ * @property {boolean} isFinal
+ * @property {boolean} isStatic
+ * @property {string} visibility
+ */
+const Method = fn.extends(function Method() {
+  fn.apply(this, arguments);
+  this.kind = KIND;
+});
+
+module.exports = Method;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_namespace.js.html b/ast_namespace.js.html new file mode 100644 index 000000000..b63fa9e8e --- /dev/null +++ b/ast_namespace.js.html @@ -0,0 +1,169 @@ + + + + + + + + + + + ast/namespace.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/namespace.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Block = require("./block");
+const KIND = "namespace";
+
+/**
+ * The main program node
+ * @constructor Namespace
+ * @extends {Block}
+ * @property {String} name
+ * @property {Boolean} withBrackets
+ */
+const Namespace = Block.extends(function Namespace(
+  name,
+  children,
+  withBrackets,
+  docs,
+  location
+) {
+  Block.apply(this, [KIND, children, docs, location]);
+  this.name = name;
+  this.withBrackets = withBrackets || false;
+});
+
+module.exports = Namespace;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_new.js.html b/ast_new.js.html new file mode 100644 index 000000000..9253e34f3 --- /dev/null +++ b/ast_new.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/new.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/new.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "new";
+
+/**
+ * Creates a new instance of the specified class
+ * @constructor New
+ * @extends {Statement}
+ * @property {Identifier|Variable|Class} what
+ * @property {Arguments[]} arguments
+ */
+const New = Statement.extends(function New(what, args, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.what = what;
+  this.arguments = args;
+});
+
+module.exports = New;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_node.js.html b/ast_node.js.html new file mode 100644 index 000000000..658c7ef16 --- /dev/null +++ b/ast_node.js.html @@ -0,0 +1,198 @@ + + + + + + + + + + + ast/node.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/node.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+/**
+ * A generic AST node
+ * @constructor Node
+ * @property {Location|null} loc
+ * @property {Comment[]} leadingComments
+ * @property {Comment[]?} trailingComments
+ * @property {String} kind
+ */
+const Node = function Node(kind, docs, location) {
+  this.kind = kind;
+  if (docs) {
+    this.leadingComments = docs;
+  }
+  if (location) {
+    this.loc = location;
+  }
+};
+
+/**
+ * Includes current token position of the parser
+ * @param {*} parser
+ */
+Node.prototype.includeToken = function(parser) {
+  if (this.loc) {
+    if (this.loc.end) {
+      this.loc.end.line = parser.lexer.yylloc.last_line;
+      this.loc.end.column = parser.lexer.yylloc.last_column;
+      this.loc.end.offset = parser.lexer.offset;
+    }
+    if (parser.ast.withSource) {
+      this.loc.source = parser.lexer._input.substring(
+        this.loc.start.offset,
+        parser.lexer.offset
+      );
+    }
+  }
+  return this;
+};
+
+/**
+ * Helper for extending the Node class
+ * @param {Function} constructor
+ * @return {Function}
+ */
+Node.extends = function(constructor) {
+  constructor.prototype = Object.create(this.prototype);
+  constructor.extends = this.extends;
+  constructor.prototype.constructor = constructor;
+  return constructor;
+};
+
+module.exports = Node;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_nowdoc.js.html b/ast_nowdoc.js.html new file mode 100644 index 000000000..5364508d0 --- /dev/null +++ b/ast_nowdoc.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/nowdoc.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/nowdoc.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Literal = require("./literal");
+const KIND = "nowdoc";
+
+/**
+ * Defines a nowdoc string
+ * @constructor String
+ * @extends {Literal}
+ * @property {String} label
+ * @property {String} raw
+ * @property {Boolean} quote
+ */
+const Nowdoc = Literal.extends(function Nowdoc(
+  value,
+  raw,
+  label,
+  quote,
+  docs,
+  location
+) {
+  Literal.apply(this, [KIND, value, raw, docs, location]);
+  this.label = label;
+  this.quote = quote;
+});
+
+module.exports = Nowdoc;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_number.js.html b/ast_number.js.html new file mode 100644 index 000000000..cad24fdfb --- /dev/null +++ b/ast_number.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/number.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/number.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Literal = require("./literal");
+const KIND = "number";
+
+/**
+ * Defines a numeric value
+ * @constructor Number
+ * @extends {Literal}
+ */
+const _Number = Literal.extends(function Number(value, raw, docs, location) {
+  Literal.apply(this, [KIND, value, raw, docs, location]);
+});
+
+module.exports = _Number;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_offsetlookup.js.html b/ast_offsetlookup.js.html new file mode 100644 index 000000000..11d00b61a --- /dev/null +++ b/ast_offsetlookup.js.html @@ -0,0 +1,164 @@ + + + + + + + + + + + ast/offsetlookup.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/offsetlookup.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Lookup = require("./lookup");
+const KIND = "offsetlookup";
+
+/**
+ * Lookup on an offset in an array
+ * @constructor OffsetLookup
+ * @extends {Lookup}
+ */
+const OffsetLookup = Lookup.extends(function OffsetLookup(
+  what,
+  offset,
+  docs,
+  location
+) {
+  Lookup.apply(this, [KIND, what, offset, docs, location]);
+});
+
+module.exports = OffsetLookup;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_operation.js.html b/ast_operation.js.html new file mode 100644 index 000000000..a13f1192b --- /dev/null +++ b/ast_operation.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/operation.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/operation.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Expr = require("./expression");
+const KIND = "operation";
+
+/**
+ * Defines binary operations
+ * @constructor Operation
+ * @extends {Expression}
+ */
+const Operation = Expr.extends(function Operation(kind, docs, location) {
+  Expr.apply(this, [kind || KIND, docs, location]);
+});
+
+module.exports = Operation;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_parameter.js.html b/ast_parameter.js.html new file mode 100644 index 000000000..be5b309e9 --- /dev/null +++ b/ast_parameter.js.html @@ -0,0 +1,178 @@ + + + + + + + + + + + ast/parameter.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/parameter.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Declaration = require("./declaration");
+const KIND = "parameter";
+
+/**
+ * Defines a function parameter
+ * @constructor Parameter
+ * @extends {Declaration}
+ * @property {Identifier|null} type
+ * @property {Node|null} value
+ * @property {boolean} byref
+ * @property {boolean} variadic
+ * @property {boolean} nullable
+ */
+const Parameter = Declaration.extends(function Parameter(
+  name,
+  type,
+  value,
+  isRef,
+  isVariadic,
+  nullable,
+  docs,
+  location
+) {
+  Declaration.apply(this, [KIND, name, docs, location]);
+  this.value = value;
+  this.type = type;
+  this.byref = isRef;
+  this.variadic = isVariadic;
+  this.nullable = nullable;
+});
+
+module.exports = Parameter;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_parenthesis.js.html b/ast_parenthesis.js.html new file mode 100644 index 000000000..b50e56ebd --- /dev/null +++ b/ast_parenthesis.js.html @@ -0,0 +1,165 @@ + + + + + + + + + + + ast/parenthesis.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/parenthesis.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Operation = require("./operation");
+const KIND = "parenthesis";
+
+/**
+ * Parenthesis encapsulation `(... expr ...)`
+ * @constructor Parenthesis
+ * @extends {Operation}
+ * @property {Expression} inner
+ */
+const Parenthesis = Operation.extends(function Parenthesis(
+  inner,
+  docs,
+  location
+) {
+  Operation.apply(this, [KIND, docs, location]);
+  this.inner = inner;
+});
+
+module.exports = Parenthesis;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_position.js.html b/ast_position.js.html new file mode 100644 index 000000000..2a58ba8b2 --- /dev/null +++ b/ast_position.js.html @@ -0,0 +1,160 @@ + + + + + + + + + + + ast/position.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/position.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+/**
+ * Each Position object consists of a line number (1-indexed) and a column number (0-indexed):
+ * @constructor Position
+ * @property {Number} line
+ * @property {Number} column
+ * @property {Number} offset
+ */
+const Position = function(line, column, offset) {
+  this.line = line;
+  this.column = column;
+  this.offset = offset;
+};
+
+module.exports = Position;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_post.js.html b/ast_post.js.html new file mode 100644 index 000000000..8012b09ad --- /dev/null +++ b/ast_post.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/post.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/post.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Operation = require("./operation");
+const KIND = "post";
+
+/**
+ * Defines a post operation `$i++` or `$i--`
+ * @constructor Post
+ * @extends {Operation}
+ * @property {String} type
+ * @property {Variable} what
+ */
+const Post = Operation.extends(function Post(type, what, docs, location) {
+  Operation.apply(this, [KIND, docs, location]);
+  this.type = type;
+  this.what = what;
+});
+
+module.exports = Post;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_pre.js.html b/ast_pre.js.html new file mode 100644 index 000000000..f9d52514c --- /dev/null +++ b/ast_pre.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/pre.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/pre.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Operation = require("./operation");
+const KIND = "pre";
+
+/**
+ * Defines a pre operation `++$i` or `--$i`
+ * @constructor Pre
+ * @extends {Operation}
+ * @property {String} type
+ * @property {Variable} what
+ */
+const Pre = Operation.extends(function Pre(type, what, docs, location) {
+  Operation.apply(this, [KIND, docs, location]);
+  this.type = type;
+  this.what = what;
+});
+
+module.exports = Pre;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_print.js.html b/ast_print.js.html new file mode 100644 index 000000000..7b7abc0e5 --- /dev/null +++ b/ast_print.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/print.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/print.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Sys = require("./sys");
+const KIND = "print";
+
+/**
+ * Outputs
+ * @constructor Print
+ * @extends {Sys}
+ */
+const Print = Sys.extends(function Print(args, docs, location) {
+  Sys.apply(this, [KIND, args, docs, location]);
+});
+
+module.exports = Print;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_program.js.html b/ast_program.js.html new file mode 100644 index 000000000..ad3c449cd --- /dev/null +++ b/ast_program.js.html @@ -0,0 +1,176 @@ + + + + + + + + + + + ast/program.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/program.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Block = require("./block");
+const KIND = "program";
+
+/**
+ * The main program node
+ * @constructor Program
+ * @extends {Block}
+ * @property {Error[]} errors
+ * @property {Doc[]?} comments
+ * @property {String[]?} tokens
+ */
+const Program = Block.extends(function Program(
+  children,
+  errors,
+  comments,
+  tokens,
+  docs,
+  location
+) {
+  Block.apply(this, [KIND, children, docs, location]);
+  this.errors = errors;
+  if (comments) {
+    this.comments = comments;
+  }
+  if (tokens) {
+    this.tokens = tokens;
+  }
+});
+
+module.exports = Program;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_property.js.html b/ast_property.js.html new file mode 100644 index 000000000..2e9690aab --- /dev/null +++ b/ast_property.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/property.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/property.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Declaration = require("./declaration");
+const KIND = "property";
+
+/**
+ * Defines a class property
+ * @constructor Property
+ * @extends {Declaration}
+ * @property {boolean} isFinal
+ * @property {boolean} isStatic
+ * @property {string} visibility
+ * @property {Node|null} value
+ */
+const Property = Declaration.extends(function Property(
+  name,
+  value,
+  flags,
+  docs,
+  location
+) {
+  Declaration.apply(this, [KIND, name, docs, location]);
+  this.value = value;
+  this.parseFlags(flags);
+});
+
+module.exports = Property;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_propertylookup.js.html b/ast_propertylookup.js.html new file mode 100644 index 000000000..b7a77f3e4 --- /dev/null +++ b/ast_propertylookup.js.html @@ -0,0 +1,164 @@ + + + + + + + + + + + ast/propertylookup.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/propertylookup.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Lookup = require("./lookup");
+const KIND = "propertylookup";
+
+/**
+ * Lookup to an object property
+ * @constructor PropertyLookup
+ * @extends {Lookup}
+ */
+const PropertyLookup = Lookup.extends(function PropertyLookup(
+  what,
+  offset,
+  docs,
+  location
+) {
+  Lookup.apply(this, [KIND, what, offset, docs, location]);
+});
+
+module.exports = PropertyLookup;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_retif.js.html b/ast_retif.js.html new file mode 100644 index 000000000..6039222aa --- /dev/null +++ b/ast_retif.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/retif.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/retif.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "retif";
+
+/**
+ * Defines a short if statement that returns a value
+ * @constructor RetIf
+ * @extends {Statement}
+ * @property {Expression} test
+ * @property {Expression} trueExpr
+ * @property {Expression} falseExpr
+ */
+const RetIf = Statement.extends(function RetIf(
+  test,
+  trueExpr,
+  falseExpr,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.test = test;
+  this.trueExpr = trueExpr;
+  this.falseExpr = falseExpr;
+});
+
+module.exports = RetIf;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_return.js.html b/ast_return.js.html new file mode 100644 index 000000000..a6bfa96e8 --- /dev/null +++ b/ast_return.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/return.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/return.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "return";
+
+/**
+ * A continue statement
+ * @constructor Return
+ * @extends {Node}
+ * @property {Expression|null} expr
+ */
+const Return = Node.extends(function Return(expr, docs, location) {
+  Node.apply(this, [KIND, docs, location]);
+  this.expr = expr;
+});
+
+module.exports = Return;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_silent.js.html b/ast_silent.js.html new file mode 100644 index 000000000..5ab04b04c --- /dev/null +++ b/ast_silent.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/silent.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/silent.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "silent";
+
+/**
+ * Avoids to show/log warnings & notices from the inner expression
+ * @constructor Silent
+ * @extends {Statement}
+ * @property {Expression} expr
+ */
+const Silent = Statement.extends(function Silent(expr, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.expr = expr;
+});
+
+module.exports = Silent;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_statement.js.html b/ast_statement.js.html new file mode 100644 index 000000000..27ad0da2b --- /dev/null +++ b/ast_statement.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/statement.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/statement.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "statement";
+
+/**
+ * Any statement.
+ * @constructor Statement
+ * @extends {Node}
+ */
+const Statement = Node.extends(function Statement(kind, docs, location) {
+  Node.apply(this, [kind || KIND, docs, location]);
+});
+
+module.exports = Statement;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_static.js.html b/ast_static.js.html new file mode 100644 index 000000000..cf3c630cc --- /dev/null +++ b/ast_static.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/static.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/static.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "static";
+
+/**
+ * Declares a static variable into the current scope
+ * @constructor Static
+ * @extends {Statement}
+ * @property {Variable[]|Assign[]} items
+ */
+const Static = Statement.extends(function Static(items, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.items = items;
+});
+
+module.exports = Static;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_staticlookup.js.html b/ast_staticlookup.js.html new file mode 100644 index 000000000..626c8b21b --- /dev/null +++ b/ast_staticlookup.js.html @@ -0,0 +1,164 @@ + + + + + + + + + + + ast/staticlookup.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/staticlookup.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Lookup = require("./lookup");
+const KIND = "staticlookup";
+
+/**
+ * Lookup to a static property
+ * @constructor StaticLookup
+ * @extends {Lookup}
+ */
+const StaticLookup = Lookup.extends(function StaticLookup(
+  what,
+  offset,
+  docs,
+  location
+) {
+  Lookup.apply(this, [KIND, what, offset, docs, location]);
+});
+
+module.exports = StaticLookup;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_string.js.html b/ast_string.js.html new file mode 100644 index 000000000..b84dc608c --- /dev/null +++ b/ast_string.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/string.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/string.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Literal = require("./literal");
+const KIND = "string";
+
+/**
+ * Defines a string (simple ou double quoted) - chars are already escaped
+ * @constructor String
+ * @extends {Literal}
+ * @property {boolean} unicode
+ * @property {boolean} isDoubleQuote
+ * @see {Encapsed}
+ */
+const String = Literal.extends(function String(
+  isDoubleQuote,
+  value,
+  unicode,
+  raw,
+  docs,
+  location
+) {
+  Literal.apply(this, [KIND, value, raw, docs, location]);
+  this.unicode = unicode;
+  this.isDoubleQuote = isDoubleQuote;
+});
+
+module.exports = String;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_switch.js.html b/ast_switch.js.html new file mode 100644 index 000000000..77d68d8c5 --- /dev/null +++ b/ast_switch.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/switch.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/switch.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "switch";
+
+/**
+ * Defines a switch statement
+ * @constructor Switch
+ * @extends {Statement}
+ * @property {Expression} test
+ * @property {Block} body
+ * @property {boolean} shortForm
+ */
+const Switch = Statement.extends(function Switch(
+  test,
+  body,
+  shortForm,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.test = test;
+  this.body = body;
+  this.shortForm = shortForm;
+});
+
+module.exports = Switch;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_sys.js.html b/ast_sys.js.html new file mode 100644 index 000000000..8bbc2336c --- /dev/null +++ b/ast_sys.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/sys.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/sys.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "sys";
+
+/**
+ * Defines system based call
+ * @constructor Sys
+ * @extends {Statement}
+ * @property {Node[]} arguments
+ */
+const Sys = Statement.extends(function Sys(kind, args, docs, location) {
+  Statement.apply(this, [kind || KIND, docs, location]);
+  this.arguments = args;
+});
+
+module.exports = Sys;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_throw.js.html b/ast_throw.js.html new file mode 100644 index 000000000..45263cf60 --- /dev/null +++ b/ast_throw.js.html @@ -0,0 +1,161 @@ + + + + + + + + + + + ast/throw.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/throw.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "throw";
+
+/**
+ * Defines a throw statement
+ * @constructor Throw
+ * @extends {Statement}
+ * @property {Expression} what
+ */
+const Throw = Statement.extends(function Throw(what, docs, location) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.what = what;
+});
+
+module.exports = Throw;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_trait.js.html b/ast_trait.js.html new file mode 100644 index 000000000..b526db070 --- /dev/null +++ b/ast_trait.js.html @@ -0,0 +1,172 @@ + + + + + + + + + + + ast/trait.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/trait.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Declaration = require("./declaration");
+const KIND = "trait";
+
+/**
+ * A trait definition
+ * @constructor Trait
+ * @extends {Declaration}
+ * @property {Identifier|null} extends
+ * @property {Identifier[]} implements
+ * @property {Declaration[]} body
+ */
+const Trait = Declaration.extends(function Trait(
+  name,
+  ext,
+  impl,
+  body,
+  docs,
+  location
+) {
+  Declaration.apply(this, [KIND, name, docs, location]);
+  this.extends = ext;
+  this.implements = impl;
+  this.body = body;
+});
+
+module.exports = Trait;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_traitalias.js.html b/ast_traitalias.js.html new file mode 100644 index 000000000..c95e6b8d3 --- /dev/null +++ b/ast_traitalias.js.html @@ -0,0 +1,188 @@ + + + + + + + + + + + ast/traitalias.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/traitalias.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "traitalias";
+
+const IS_UNDEFINED = "";
+const IS_PUBLIC = "public";
+const IS_PROTECTED = "protected";
+const IS_PRIVATE = "private";
+
+/**
+ * Defines a trait alias
+ * @constructor TraitAlias
+ * @extends {Node}
+ * @property {Identifier|null} trait
+ * @property {string} method
+ * @property {string|null} as
+ * @property {string|null} visibility
+ */
+const TraitAlias = Node.extends(function TraitAlias(
+  trait,
+  method,
+  as,
+  flags,
+  docs,
+  location
+) {
+  Node.apply(this, [KIND, docs, location]);
+  this.trait = trait;
+  this.method = method;
+  this.as = as;
+  this.visibility = IS_UNDEFINED;
+  if (flags) {
+    if (flags[0] === 0) {
+      this.visibility = IS_PUBLIC;
+    } else if (flags[0] === 1) {
+      this.visibility = IS_PROTECTED;
+    } else if (flags[0] === 2) {
+      this.visibility = IS_PRIVATE;
+    }
+  }
+});
+
+module.exports = TraitAlias;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_traitprecedence.js.html b/ast_traitprecedence.js.html new file mode 100644 index 000000000..fc1ff973e --- /dev/null +++ b/ast_traitprecedence.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/traitprecedence.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/traitprecedence.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "traitprecedence";
+
+/**
+ * Defines a trait alias
+ * @constructor TraitPrecedence
+ * @extends {Node}
+ * @property {Identifier|null} trait
+ * @property {string} method
+ * @property {Identifier[]} instead
+ */
+const TraitPrecedence = Node.extends(function TraitPrecedence(
+  trait,
+  method,
+  instead,
+  docs,
+  location
+) {
+  Node.apply(this, [KIND, docs, location]);
+  this.trait = trait;
+  this.method = method;
+  this.instead = instead;
+});
+
+module.exports = TraitPrecedence;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_traituse.js.html b/ast_traituse.js.html new file mode 100644 index 000000000..346bd1fc7 --- /dev/null +++ b/ast_traituse.js.html @@ -0,0 +1,168 @@ + + + + + + + + + + + ast/traituse.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/traituse.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Node = require("./node");
+const KIND = "traituse";
+
+/**
+ * Defines a trait usage
+ * @constructor TraitUse
+ * @extends {Node}
+ * @property {Identifier[]} traits
+ * @property {Node[]|null} adaptations
+ */
+const TraitUse = Node.extends(function TraitUse(
+  traits,
+  adaptations,
+  docs,
+  location
+) {
+  Node.apply(this, [KIND, docs, location]);
+  this.traits = traits;
+  this.adaptations = adaptations;
+});
+
+module.exports = TraitUse;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_try.js.html b/ast_try.js.html new file mode 100644 index 000000000..96f0edb27 --- /dev/null +++ b/ast_try.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/try.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/try.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "try";
+
+/**
+ * Defines a try statement
+ * @constructor Try
+ * @extends {Statement}
+ * @property {Block} body
+ * @property {Catch[]} catches
+ * @property {Block} allways
+ */
+const Try = Statement.extends(function Try(
+  body,
+  catches,
+  always,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.body = body;
+  this.catches = catches;
+  this.always = always;
+});
+
+module.exports = Try;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_unary.js.html b/ast_unary.js.html new file mode 100644 index 000000000..678848924 --- /dev/null +++ b/ast_unary.js.html @@ -0,0 +1,163 @@ + + + + + + + + + + + ast/unary.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/unary.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Operation = require("./operation");
+const KIND = "unary";
+
+/**
+ * Unary operations
+ * @constructor Unary
+ * @extends {Operation}
+ * @property {String} type
+ * @property {Expression} what
+ */
+const Unary = Operation.extends(function Unary(type, what, docs, location) {
+  Operation.apply(this, [KIND, docs, location]);
+  this.type = type;
+  this.what = what;
+});
+
+module.exports = Unary;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_unset.js.html b/ast_unset.js.html new file mode 100644 index 000000000..ce796f486 --- /dev/null +++ b/ast_unset.js.html @@ -0,0 +1,159 @@ + + + + + + + + + + + ast/unset.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/unset.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Sys = require("./sys");
+const KIND = "unset";
+
+/**
+ * Deletes references to a list of variables
+ * @constructor Unset
+ * @extends {Sys}
+ */
+const Unset = Sys.extends(function Unset(args, docs, location) {
+  Sys.apply(this, [KIND, args, docs, location]);
+});
+
+module.exports = Unset;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_usegroup.js.html b/ast_usegroup.js.html new file mode 100644 index 000000000..0f3d49b12 --- /dev/null +++ b/ast_usegroup.js.html @@ -0,0 +1,173 @@ + + + + + + + + + + + ast/usegroup.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/usegroup.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "usegroup";
+
+/**
+ * Defines a use statement (with a list of use items)
+ * @constructor UseGroup
+ * @extends {Statement}
+ * @property {String|null} name
+ * @property {String|null} type - Possible value : function, const
+ * @property {UseItem[]} item
+ * @see {Namespace}
+ * @see http://php.net/manual/en/language.namespaces.importing.php
+ */
+const UseGroup = Statement.extends(function UseGroup(
+  name,
+  type,
+  items,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.name = name;
+  this.type = type;
+  this.items = items;
+});
+
+module.exports = UseGroup;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_useitem.js.html b/ast_useitem.js.html new file mode 100644 index 000000000..aa1bf70ee --- /dev/null +++ b/ast_useitem.js.html @@ -0,0 +1,184 @@ + + + + + + + + + + + ast/useitem.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/useitem.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "useitem";
+
+/**
+ * Defines a use statement (from namespace)
+ * @constructor UseItem
+ * @extends {Statement}
+ * @property {String} name
+ * @property {String|null} type - Possible value : function, const
+ * @property {String|null} alias
+ * @see {Namespace}
+ * @see http://php.net/manual/en/language.namespaces.importing.php
+ */
+const UseItem = Statement.extends(function UseItem(
+  name,
+  alias,
+  type,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.name = name;
+  this.alias = alias;
+  this.type = type;
+});
+
+/**
+ * Importing a constant
+ * @constant {String} TYPE_CONST
+ */
+UseItem.TYPE_CONST = "const";
+/**
+ * Importing a function
+ * @constant {String} TYPE_FUNC
+ */
+UseItem.TYPE_FUNCTION = "function";
+
+module.exports = UseItem;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_variable.js.html b/ast_variable.js.html new file mode 100644 index 000000000..9288cfa6d --- /dev/null +++ b/ast_variable.js.html @@ -0,0 +1,182 @@ + + + + + + + + + + + ast/variable.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/variable.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Expr = require("./expression");
+const KIND = "variable";
+
+/**
+ * Any expression node. Since the left-hand side of an assignment may
+ * be any expression in general, an expression can also be a pattern.
+ * @constructor Variable
+ * @extends {Expression}
+ * @example
+ * // PHP code :
+ * &$foo
+ * // AST output
+ * {
+ *  "kind": "variable",
+ *  "name": "foo",
+ *  "byref": true,
+ *  "curly": false
+ * }
+ * @property {String|Node} name The variable name (can be a complex expression when the name is resolved dynamically)
+ * @property {boolean} byref Indicate if the variable reference is used, ex `&$foo`
+ * @property {boolean} curly Indicate if the name is defined between curlies, ex `${foo}`
+ */
+const Variable = Expr.extends(function Variable(
+  name,
+  byref,
+  curly,
+  docs,
+  location
+) {
+  Expr.apply(this, [KIND, docs, location]);
+  this.name = name;
+  this.byref = byref || false;
+  this.curly = curly || false;
+});
+
+module.exports = Variable;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_variadic.js.html b/ast_variadic.js.html new file mode 100644 index 000000000..9aa091741 --- /dev/null +++ b/ast_variadic.js.html @@ -0,0 +1,162 @@ + + + + + + + + + + + ast/variadic.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/variadic.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Expr = require("./expression");
+const KIND = "variadic";
+
+/**
+ * Introduce a list of items into the arguments of the call
+ * @constructor variadic
+ * @extends {Expression}
+ * @property {Array|Expression} what
+ * @see https://wiki.php.net/rfc/argument_unpacking
+ */
+const variadic = Expr.extends(function variadic(what, docs, location) {
+  Expr.apply(this, [KIND, docs, location]);
+  this.what = what;
+});
+
+module.exports = variadic;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_while.js.html b/ast_while.js.html new file mode 100644 index 000000000..098e1ad73 --- /dev/null +++ b/ast_while.js.html @@ -0,0 +1,171 @@ + + + + + + + + + + + ast/while.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/while.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Statement = require("./statement");
+const KIND = "while";
+
+/**
+ * Defines a while statement
+ * @constructor While
+ * @extends {Statement}
+ * @property {Expression} test
+ * @property {Statement} body
+ * @property {boolean} shortForm
+ */
+const While = Statement.extends(function While(
+  test,
+  body,
+  shortForm,
+  docs,
+  location
+) {
+  Statement.apply(this, [KIND, docs, location]);
+  this.test = test;
+  this.body = body;
+  this.shortForm = shortForm;
+});
+
+module.exports = While;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_yield.js.html b/ast_yield.js.html new file mode 100644 index 000000000..cbc41baab --- /dev/null +++ b/ast_yield.js.html @@ -0,0 +1,164 @@ + + + + + + + + + + + ast/yield.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/yield.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Expression = require("./expression");
+const KIND = "yield";
+
+/**
+ * Defines a yield generator statement
+ * @constructor Yield
+ * @extends {Expression}
+ * @property {Expression|Null} value
+ * @property {Expression|Null} key
+ * @see http://php.net/manual/en/language.generators.syntax.php
+ */
+const Yield = Expression.extends(function Yield(value, key, docs, location) {
+  Expression.apply(this, [KIND, docs, location]);
+  this.value = value;
+  this.key = key;
+});
+
+module.exports = Yield;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/ast_yieldfrom.js.html b/ast_yieldfrom.js.html new file mode 100644 index 000000000..3c7ca97cd --- /dev/null +++ b/ast_yieldfrom.js.html @@ -0,0 +1,162 @@ + + + + + + + + + + + ast/yieldfrom.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ ast/yieldfrom.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const Expression = require("./expression");
+const KIND = "yieldfrom";
+
+/**
+ * Defines a yield from generator statement
+ * @constructor YieldFrom
+ * @extends {Expression}
+ * @property {Expression} value
+ * @see http://php.net/manual/en/language.generators.syntax.php
+ */
+const YieldFrom = Expression.extends(function YieldFrom(value, docs, location) {
+  Expression.apply(this, [KIND, docs, location]);
+  this.value = value;
+});
+
+module.exports = YieldFrom;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/dist/php-parser.js b/dist/php-parser.js deleted file mode 100644 index a3470ac16..000000000 --- a/dist/php-parser.js +++ /dev/null @@ -1,11114 +0,0 @@ -/*! - * - * Package: php-parser - * Parse PHP code and returns its AST - * Build: 40e3f5cb8f8a414e42e0 - 2018-8-17 - * License: BSD-3-Clause - * Author: Ioan CHIRIAC - * - */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["PhpParser"] = factory(); - else - root["PhpParser"] = factory(); -})(window, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 122); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "statement"; - -/** - * Any statement. - * @constructor Statement - * @extends {Node} - */ -var Statement = Node.extends(function Statement(kind, docs, location) { - Node.apply(this, [kind || KIND, docs, location]); -}); - -module.exports = Statement; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -/** - * A generic AST node - * @constructor Node - * @property {Location|null} loc - * @property {Comment[]} leadingComments - * @property {Comment[]?} trailingComments - * @property {String} kind - */ - -var Node = function Node(kind, docs, location) { - this.kind = kind; - if (docs) { - this.leadingComments = docs; - } - if (location) { - this.loc = location; - } -}; - -/** - * Includes current token position of the parser - * @param {*} parser - */ -Node.prototype.includeToken = function (parser) { - if (this.loc) { - if (this.loc.end) { - this.loc.end.line = parser.lexer.yylloc.last_line; - this.loc.end.column = parser.lexer.yylloc.last_column; - this.loc.end.offset = parser.lexer.offset; - } - if (parser.ast.withSource) { - this.loc.source = parser.lexer._input.substring(this.loc.start.offset, parser.lexer.offset); - } - } - return this; -}; - -/** - * Helper for extending the Node class - * @param {Function} constructor - * @return {Function} - */ -Node.extends = function (constructor) { - constructor.prototype = Object.create(this.prototype); - constructor.extends = this.extends; - constructor.prototype.constructor = constructor; - return constructor; -}; - -module.exports = Node; - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "expression"; - -/** - * Any expression node. Since the left-hand side of an assignment may - * be any expression in general, an expression can also be a pattern. - * @constructor Expression - * @extends {Node} - */ -var Expression = Node.extends(function Expression(kind, docs, location) { - Node.apply(this, [kind || KIND, docs, location]); -}); - -module.exports = Expression; - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "declaration"; - -var IS_UNDEFINED = ""; -var IS_PUBLIC = "public"; -var IS_PROTECTED = "protected"; -var IS_PRIVATE = "private"; - -/** - * A declaration statement (function, class, interface...) - * @constructor Declaration - * @extends {Statement} - * @property {string} name - */ -var Declaration = Statement.extends(function Declaration(kind, name, docs, location) { - Statement.apply(this, [kind || KIND, docs, location]); - this.name = name; -}); - -/** - * Generic flags parser - * @param {Integer[]} flags - * @return {void} - */ -Declaration.prototype.parseFlags = function (flags) { - this.isAbstract = flags[2] === 1; - this.isFinal = flags[2] === 2; - if (this.kind !== "class") { - if (flags[0] === -1) { - this.visibility = IS_UNDEFINED; - } else if (flags[0] === 0) { - this.visibility = IS_PUBLIC; - } else if (flags[0] === 1) { - this.visibility = IS_PROTECTED; - } else if (flags[0] === 2) { - this.visibility = IS_PRIVATE; - } - this.isStatic = flags[1] === 1; - } -}; - -module.exports = Declaration; - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Expr = __webpack_require__(2); -var KIND = "literal"; - -/** - * Defines an array structure - * @constructor Literal - * @extends {Expression} - * @property {string} raw - * @property {Node|string|number|boolean|null} value - */ -var Literal = Expr.extends(function Literal(kind, value, raw, docs, location) { - Expr.apply(this, [kind || KIND, docs, location]); - this.value = value; - if (raw) { - this.raw = raw; - } -}); - -module.exports = Literal; - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "sys"; - -/** - * Defines system based call - * @constructor Sys - * @extends {Statement} - * @property {Node[]} arguments - */ -var Sys = Statement.extends(function Sys(kind, args, docs, location) { - Statement.apply(this, [kind || KIND, docs, location]); - this.arguments = args; -}); - -module.exports = Sys; - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Expr = __webpack_require__(2); -var KIND = "operation"; - -/** - * Defines binary operations - * @constructor Operation - * @extends {Expression} - */ -var Operation = Expr.extends(function Operation(kind, docs, location) { - Expr.apply(this, [kind || KIND, docs, location]); -}); - -module.exports = Operation; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Expr = __webpack_require__(2); -var KIND = "lookup"; - -/** - * Lookup on an offset in the specified object - * @constructor Lookup - * @extends {Expression} - * @property {Expression} what - * @property {Expression} offset - */ -var Lookup = Expr.extends(function Lookup(kind, what, offset, docs, location) { - Expr.apply(this, [kind || KIND, docs, location]); - this.what = what; - this.offset = offset; -}); - -module.exports = Lookup; - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "block"; - -/** - * A block statement, i.e., a sequence of statements surrounded by braces. - * @constructor Block - * @extends {Statement} - * @property {Node[]} children - */ -var Block = Statement.extends(function Block(kind, children, docs, location) { - Statement.apply(this, [kind || KIND, docs, location]); - this.children = children.filter(Boolean); -}); - -module.exports = Block; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); - -/** - * Abstract documentation node (ComentLine or CommentBlock) - * @constructor Comment - * @extends {Node} - * @property {String} value - */ -var Comment = Node.extends(function Comment(kind, value, docs, location) { - Node.apply(this, [kind, docs, location]); - this.value = value; -}); - -module.exports = Comment; - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Declaration = __webpack_require__(3); -var KIND = "function"; - -/** - * Defines a classic function - * @constructor Function - * @extends {Declaration} - * @property {Parameter[]} arguments - * @property {Identifier} type - * @property {boolean} byref - * @property {boolean} nullable - * @property {Block|null} body - */ -var fn = Declaration.extends(function _Function(name, args, byref, type, nullable, docs, location) { - Declaration.apply(this, [KIND, name, docs, location]); - this.arguments = args; - this.byref = byref; - this.type = type; - this.nullable = nullable; - this.body = null; -}); -module.exports = fn; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Declaration = __webpack_require__(3); -var KIND = "constant"; - -/** - * Defines a namespace constant - * @constructor Constant - * @extends {Declaration} - * @property {Node|null} value - */ -var Constant = Declaration.extends(function Constant(name, value, docs, location) { - Declaration.apply(this, [KIND, name, docs, location]); - this.value = value; -}); - -module.exports = Constant; - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Expression = __webpack_require__(2); -var KIND = "yieldfrom"; - -/** - * Defines a yield from generator statement - * @constructor YieldFrom - * @extends {Expression} - * @property {Expression} value - * @see http://php.net/manual/en/language.generators.syntax.php - */ -var YieldFrom = Expression.extends(function YieldFrom(value, docs, location) { - Expression.apply(this, [KIND, docs, location]); - this.value = value; -}); - -module.exports = YieldFrom; - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Expression = __webpack_require__(2); -var KIND = "yield"; - -/** - * Defines a yield generator statement - * @constructor Yield - * @extends {Expression} - * @property {Expression|Null} value - * @property {Expression|Null} key - * @see http://php.net/manual/en/language.generators.syntax.php - */ -var Yield = Expression.extends(function Yield(value, key, docs, location) { - Expression.apply(this, [KIND, docs, location]); - this.value = value; - this.key = key; -}); - -module.exports = Yield; - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "while"; - -/** - * Defines a while statement - * @constructor While - * @extends {Statement} - * @property {Expression} test - * @property {Statement} body - * @property {boolean} shortForm - */ -var While = Statement.extends(function While(test, body, shortForm, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.test = test; - this.body = body; - this.shortForm = shortForm; -}); - -module.exports = While; - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Expr = __webpack_require__(2); -var KIND = "variadic"; - -/** - * Introduce a list of items into the arguments of the call - * @constructor variadic - * @extends {Expression} - * @property {Array|Expression} what - * @see https://wiki.php.net/rfc/argument_unpacking - */ -var variadic = Expr.extends(function variadic(what, docs, location) { - Expr.apply(this, [KIND, docs, location]); - this.what = what; -}); - -module.exports = variadic; - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Expr = __webpack_require__(2); -var KIND = "variable"; - -/** - * Any expression node. Since the left-hand side of an assignment may - * be any expression in general, an expression can also be a pattern. - * @constructor Variable - * @extends {Expression} - * @example - * // PHP code : - * &$foo - * // AST output - * { - * "kind": "variable", - * "name": "foo", - * "byref": true, - * "curly": false - * } - * @property {String|Node} name The variable name (can be a complex expression when the name is resolved dynamically) - * @property {boolean} byref Indicate if the variable reference is used, ex `&$foo` - * @property {boolean} curly Indicate if the name is defined between curlies, ex `${foo}` - */ -var Variable = Expr.extends(function Variable(name, byref, curly, docs, location) { - Expr.apply(this, [KIND, docs, location]); - this.name = name; - this.byref = byref || false; - this.curly = curly || false; -}); - -module.exports = Variable; - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "useitem"; - -/** - * Defines a use statement (from namespace) - * @constructor UseItem - * @extends {Statement} - * @property {String} name - * @property {String|null} type - Possible value : function, const - * @property {String|null} alias - * @see {Namespace} - * @see http://php.net/manual/en/language.namespaces.importing.php - */ -var UseItem = Statement.extends(function UseItem(name, alias, type, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.name = name; - this.alias = alias; - this.type = type; -}); - -/** - * Importing a constant - * @constant {String} TYPE_CONST - */ -UseItem.TYPE_CONST = "const"; -/** - * Importing a function - * @constant {String} TYPE_FUNC - */ -UseItem.TYPE_FUNCTION = "function"; - -module.exports = UseItem; - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "usegroup"; - -/** - * Defines a use statement (with a list of use items) - * @constructor UseGroup - * @extends {Statement} - * @property {String|null} name - * @property {String|null} type - Possible value : function, const - * @property {UseItem[]} item - * @see {Namespace} - * @see http://php.net/manual/en/language.namespaces.importing.php - */ -var UseGroup = Statement.extends(function UseGroup(name, type, items, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.name = name; - this.type = type; - this.items = items; -}); - -module.exports = UseGroup; - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Sys = __webpack_require__(5); -var KIND = "unset"; - -/** - * Deletes references to a list of variables - * @constructor Unset - * @extends {Sys} - */ -var Unset = Sys.extends(function Unset(args, docs, location) { - Sys.apply(this, [KIND, args, docs, location]); -}); - -module.exports = Unset; - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Operation = __webpack_require__(6); -var KIND = "unary"; - -/** - * Unary operations - * @constructor Unary - * @extends {Operation} - * @property {String} type - * @property {Expression} what - */ -var Unary = Operation.extends(function Unary(type, what, docs, location) { - Operation.apply(this, [KIND, docs, location]); - this.type = type; - this.what = what; -}); - -module.exports = Unary; - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "try"; - -/** - * Defines a try statement - * @constructor Try - * @extends {Statement} - * @property {Block} body - * @property {Catch[]} catches - * @property {Block} allways - */ -var Try = Statement.extends(function Try(body, catches, always, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.body = body; - this.catches = catches; - this.always = always; -}); - -module.exports = Try; - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "traituse"; - -/** - * Defines a trait usage - * @constructor TraitUse - * @extends {Node} - * @property {Identifier[]} traits - * @property {Node[]|null} adaptations - */ -var TraitUse = Node.extends(function TraitUse(traits, adaptations, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.traits = traits; - this.adaptations = adaptations; -}); - -module.exports = TraitUse; - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "traitprecedence"; - -/** - * Defines a trait alias - * @constructor TraitPrecedence - * @extends {Node} - * @property {Identifier|null} trait - * @property {string} method - * @property {Identifier[]} instead - */ -var TraitPrecedence = Node.extends(function TraitPrecedence(trait, method, instead, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.trait = trait; - this.method = method; - this.instead = instead; -}); - -module.exports = TraitPrecedence; - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "traitalias"; - -var IS_UNDEFINED = ""; -var IS_PUBLIC = "public"; -var IS_PROTECTED = "protected"; -var IS_PRIVATE = "private"; - -/** - * Defines a trait alias - * @constructor TraitAlias - * @extends {Node} - * @property {Identifier|null} trait - * @property {string} method - * @property {string|null} as - * @property {string|null} visibility - */ -var TraitAlias = Node.extends(function TraitAlias(trait, method, as, flags, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.trait = trait; - this.method = method; - this.as = as; - this.visibility = IS_UNDEFINED; - if (flags) { - if (flags[0] === 0) { - this.visibility = IS_PUBLIC; - } else if (flags[0] === 1) { - this.visibility = IS_PROTECTED; - } else if (flags[0] === 2) { - this.visibility = IS_PRIVATE; - } - } -}); - -module.exports = TraitAlias; - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Declaration = __webpack_require__(3); -var KIND = "trait"; - -/** - * A trait definition - * @constructor Trait - * @extends {Declaration} - * @property {Identifier|null} extends - * @property {Identifier[]} implements - * @property {Declaration[]} body - */ -var Trait = Declaration.extends(function Trait(name, ext, impl, body, docs, location) { - Declaration.apply(this, [KIND, name, docs, location]); - this.extends = ext; - this.implements = impl; - this.body = body; -}); - -module.exports = Trait; - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "throw"; - -/** - * Defines a throw statement - * @constructor Throw - * @extends {Statement} - * @property {Expression} what - */ -var Throw = Statement.extends(function Throw(what, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.what = what; -}); - -module.exports = Throw; - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "switch"; - -/** - * Defines a switch statement - * @constructor Switch - * @extends {Statement} - * @property {Expression} test - * @property {Block} body - * @property {boolean} shortForm - */ -var Switch = Statement.extends(function Switch(test, body, shortForm, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.test = test; - this.body = body; - this.shortForm = shortForm; -}); - -module.exports = Switch; - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Literal = __webpack_require__(4); -var KIND = "string"; - -/** - * Defines a string (simple ou double quoted) - chars are already escaped - * @constructor String - * @extends {Literal} - * @property {boolean} unicode - * @property {boolean} isDoubleQuote - * @see {Encapsed} - */ -var String = Literal.extends(function String(isDoubleQuote, value, unicode, raw, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); - this.unicode = unicode; - this.isDoubleQuote = isDoubleQuote; -}); - -module.exports = String; - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Lookup = __webpack_require__(7); -var KIND = "staticlookup"; - -/** - * Lookup to a static property - * @constructor StaticLookup - * @extends {Lookup} - */ -var StaticLookup = Lookup.extends(function StaticLookup(what, offset, docs, location) { - Lookup.apply(this, [KIND, what, offset, docs, location]); -}); - -module.exports = StaticLookup; - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "static"; - -/** - * Declares a static variable into the current scope - * @constructor Static - * @extends {Statement} - * @property {Variable[]|Assign[]} items - */ -var Static = Statement.extends(function Static(items, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.items = items; -}); - -module.exports = Static; - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "silent"; - -/** - * Avoids to show/log warnings & notices from the inner expression - * @constructor Silent - * @extends {Statement} - * @property {Expression} expr - */ -var Silent = Statement.extends(function Silent(expr, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.expr = expr; -}); - -module.exports = Silent; - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "return"; - -/** - * A continue statement - * @constructor Return - * @extends {Node} - * @property {Expression|null} expr - */ -var Return = Node.extends(function Return(expr, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.expr = expr; -}); - -module.exports = Return; - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "retif"; - -/** - * Defines a short if statement that returns a value - * @constructor RetIf - * @extends {Statement} - * @property {Expression} test - * @property {Expression} trueExpr - * @property {Expression} falseExpr - */ -var RetIf = Statement.extends(function RetIf(test, trueExpr, falseExpr, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.test = test; - this.trueExpr = trueExpr; - this.falseExpr = falseExpr; -}); - -module.exports = RetIf; - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Lookup = __webpack_require__(7); -var KIND = "propertylookup"; - -/** - * Lookup to an object property - * @constructor PropertyLookup - * @extends {Lookup} - */ -var PropertyLookup = Lookup.extends(function PropertyLookup(what, offset, docs, location) { - Lookup.apply(this, [KIND, what, offset, docs, location]); -}); - -module.exports = PropertyLookup; - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Declaration = __webpack_require__(3); -var KIND = "property"; - -/** - * Defines a class property - * @constructor Property - * @extends {Declaration} - * @property {boolean} isFinal - * @property {boolean} isStatic - * @property {string} visibility - * @property {Node|null} value - */ -var Property = Declaration.extends(function Property(name, value, flags, docs, location) { - Declaration.apply(this, [KIND, name, docs, location]); - this.value = value; - this.parseFlags(flags); -}); - -module.exports = Property; - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Block = __webpack_require__(8); -var KIND = "program"; - -/** - * The main program node - * @constructor Program - * @extends {Block} - * @property {Error[]} errors - * @property {Doc[]?} comments - * @property {String[]?} tokens - */ -var Program = Block.extends(function Program(children, errors, comments, tokens, docs, location) { - Block.apply(this, [KIND, children, docs, location]); - this.errors = errors; - if (comments) { - this.comments = comments; - } - if (tokens) { - this.tokens = tokens; - } -}); - -module.exports = Program; - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Sys = __webpack_require__(5); -var KIND = "print"; - -/** - * Outputs - * @constructor Print - * @extends {Sys} - */ -var Print = Sys.extends(function Print(args, docs, location) { - Sys.apply(this, [KIND, args, docs, location]); -}); - -module.exports = Print; - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Operation = __webpack_require__(6); -var KIND = "pre"; - -/** - * Defines a pre operation `++$i` or `--$i` - * @constructor Pre - * @extends {Operation} - * @property {String} type - * @property {Variable} what - */ -var Pre = Operation.extends(function Pre(type, what, docs, location) { - Operation.apply(this, [KIND, docs, location]); - this.type = type; - this.what = what; -}); - -module.exports = Pre; - -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Operation = __webpack_require__(6); -var KIND = "post"; - -/** - * Defines a post operation `$i++` or `$i--` - * @constructor Post - * @extends {Operation} - * @property {String} type - * @property {Variable} what - */ -var Post = Operation.extends(function Post(type, what, docs, location) { - Operation.apply(this, [KIND, docs, location]); - this.type = type; - this.what = what; -}); - -module.exports = Post; - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Declaration = __webpack_require__(3); -var KIND = "parameter"; - -/** - * Defines a function parameter - * @constructor Parameter - * @extends {Declaration} - * @property {Identifier|null} type - * @property {Node|null} value - * @property {boolean} byref - * @property {boolean} variadic - * @property {boolean} nullable - */ -var Parameter = Declaration.extends(function Parameter(name, type, value, isRef, isVariadic, nullable, docs, location) { - Declaration.apply(this, [KIND, name, docs, location]); - this.value = value; - this.type = type; - this.byref = isRef; - this.variadic = isVariadic; - this.nullable = nullable; -}); - -module.exports = Parameter; - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Lookup = __webpack_require__(7); -var KIND = "offsetlookup"; - -/** - * Lookup on an offset in an array - * @constructor OffsetLookup - * @extends {Lookup} - */ -var OffsetLookup = Lookup.extends(function OffsetLookup(what, offset, docs, location) { - Lookup.apply(this, [KIND, what, offset, docs, location]); -}); - -module.exports = OffsetLookup; - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Literal = __webpack_require__(4); -var KIND = "number"; - -/** - * Defines a numeric value - * @constructor Number - * @extends {Literal} - */ -var _Number = Literal.extends(function Number(value, raw, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); -}); - -module.exports = _Number; - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Literal = __webpack_require__(4); -var KIND = "nowdoc"; - -/** - * Defines a nowdoc string - * @constructor String - * @extends {Literal} - * @property {String} label - * @property {String} raw - * @property {Boolean} quote - */ -var Nowdoc = Literal.extends(function Nowdoc(value, raw, label, quote, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); - this.label = label; - this.quote = quote; -}); - -module.exports = Nowdoc; - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "new"; - -/** - * Creates a new instance of the specified class - * @constructor New - * @extends {Statement} - * @property {Identifier|Variable|Class} what - * @property {Arguments[]} arguments - */ -var New = Statement.extends(function New(what, args, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.what = what; - this.arguments = args; -}); - -module.exports = New; - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Block = __webpack_require__(8); -var KIND = "namespace"; - -/** - * The main program node - * @constructor Namespace - * @extends {Block} - * @property {String} name - * @property {Boolean} withBrackets - */ -var Namespace = Block.extends(function Namespace(name, children, withBrackets, docs, location) { - Block.apply(this, [KIND, children, docs, location]); - this.name = name; - this.withBrackets = withBrackets || false; -}); - -module.exports = Namespace; - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var fn = __webpack_require__(10); -var KIND = "method"; - -/** - * Defines a class/interface/trait method - * @constructor Method - * @extends {Function} - * @property {boolean} isAbstract - * @property {boolean} isFinal - * @property {boolean} isStatic - * @property {string} visibility - */ -var Method = fn.extends(function Method() { - fn.apply(this, arguments); - this.kind = KIND; -}); - -module.exports = Method; - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Literal = __webpack_require__(4); -var KIND = "magic"; - -/** - * Defines magic constant - * @constructor Magic - * @extends {Literal} - */ -var Magic = Literal.extends(function Magic(value, raw, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); -}); - -module.exports = Magic; - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Sys = __webpack_require__(5); -var KIND = "list"; - -/** - * Defines list assignment - * @constructor List - * @extends {Sys} - * @property {boolean} shortForm - */ -var List = Sys.extends(function List(items, shortForm, docs, location) { - Sys.apply(this, [KIND, items, docs, location]); - this.shortForm = shortForm; -}); - -module.exports = List; - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "label"; - -/** - * A label statement (referenced by goto) - * @constructor Label - * @extends {Node} - * @property {String} name - */ -var Label = Node.extends(function Label(name, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.name = name; -}); - -module.exports = Label; - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Sys = __webpack_require__(5); -var KIND = "isset"; - -/** - * Defines an isset call - * @constructor Isset - * @extends {Sys} - */ -var Isset = Sys.extends(function Isset(args, docs, location) { - Sys.apply(this, [KIND, args, docs, location]); -}); - -module.exports = Isset; - -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Declaration = __webpack_require__(3); -var KIND = "interface"; - -/** - * An interface definition - * @constructor Interface - * @extends {Declaration} - * @property {Identifier[]} extends - * @property {Declaration[]} body - */ -var Interface = Declaration.extends(function Interface(name, ext, body, docs, location) { - Declaration.apply(this, [KIND, name, docs, location]); - this.extends = ext; - this.body = body; -}); - -module.exports = Interface; - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Literal = __webpack_require__(4); -var KIND = "inline"; - -/** - * Defines inline html output (treated as echo output) - * @constructor Inline - * @extends {Literal} - */ -var Inline = Literal.extends(function Inline(value, raw, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); -}); - -module.exports = Inline; - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "include"; - -/** - * Defines system include call - * @constructor Include - * @extends {Statement} - * @property {Node} target - * @property {boolean} once - * @property {boolean} require - */ -var Include = Statement.extends(function Include(once, require, target, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.once = once; - this.require = require; - this.target = target; -}); - -module.exports = Include; - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "if"; - -/** - * Defines a if statement - * @constructor If - * @extends {Statement} - * @property {Expression} test - * @property {Block} body - * @property {Block|If|null} alternate - * @property {boolean} shortForm - */ -var If = Statement.extends(function If(test, body, alternate, shortForm, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.test = test; - this.body = body; - this.alternate = alternate; - this.shortForm = shortForm; -}); - -module.exports = If; - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "identifier"; - -/** - * Defines an identifier node - * @constructor Identifier - * @extends {Node} - * @property {string} name - * @property {string} resolution - */ -var Identifier = Node.extends(function Identifier(name, isRelative, docs, location) { - Node.apply(this, [KIND, docs, location]); - if (isRelative) { - this.resolution = Identifier.RELATIVE_NAME; - } else if (name.length === 1) { - this.resolution = Identifier.UNQUALIFIED_NAME; - } else if (name[0] === "") { - this.resolution = Identifier.FULL_QUALIFIED_NAME; - } else { - this.resolution = Identifier.QUALIFIED_NAME; - } - this.name = name.join("\\"); -}); - -/** - * This is an identifier without a namespace separator, such as Foo - * @constant {String} UNQUALIFIED_NAME - */ -Identifier.UNQUALIFIED_NAME = "uqn"; -/** - * This is an identifier with a namespace separator, such as Foo\Bar - * @constant {String} QUALIFIED_NAME - */ -Identifier.QUALIFIED_NAME = "qn"; -/** - * This is an identifier with a namespace separator that begins with - * a namespace separator, such as \Foo\Bar. The namespace \Foo is also - * a fully qualified name. - * @constant {String} FULL_QUALIFIED_NAME - */ -Identifier.FULL_QUALIFIED_NAME = "fqn"; -/** - * This is an identifier starting with namespace, such as namespace\Foo\Bar. - * @constant {String} RELATIVE_NAME - */ -Identifier.RELATIVE_NAME = "rn"; - -module.exports = Identifier; - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "halt"; - -/** - * Halts the compiler execution - * @constructor Halt - * @extends {Statement} - * @property {String} after - String after the halt statement - * @see http://php.net/manual/en/function.halt-compiler.php - */ -var Halt = Statement.extends(function Halt(after, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.after = after; -}); - -module.exports = Halt; - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "goto"; - -/** - * Defines goto statement - * @constructor Goto - * @extends {Statement} - * @property {String} label - * @see {Label} - */ -var Goto = Statement.extends(function Goto(label, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.label = label; -}); - -module.exports = Goto; - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "global"; - -/** - * Imports a variable from the global scope - * @constructor Global - * @extends {Statement} - * @property {Variable[]} items - */ -var Global = Statement.extends(function Global(items, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.items = items; -}); - -module.exports = Global; - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "foreach"; - -/** - * Defines a foreach iterator - * @constructor Foreach - * @extends {Statement} - * @property {Expression} source - * @property {Expression|null} key - * @property {Expression} value - * @property {Statement} body - * @property {boolean} shortForm - * @see http://php.net/manual/en/control-structures.foreach.php - */ -var Foreach = Statement.extends(function Foreach(source, key, value, body, shortForm, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.source = source; - this.key = key; - this.value = value; - this.shortForm = shortForm; - this.body = body; -}); - -module.exports = Foreach; - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "for"; - -/** - * Defines a for iterator - * @constructor For - * @extends {Statement} - * @property {Expression[]} init - * @property {Expression[]} test - * @property {Expression[]} increment - * @property {Statement} body - * @property {boolean} shortForm - * @see http://php.net/manual/en/control-structures.for.php - */ -var For = Statement.extends(function For(init, test, increment, body, shortForm, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.init = init; - this.test = test; - this.increment = increment; - this.shortForm = shortForm; - this.body = body; -}); - -module.exports = For; - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "exit"; - -/** - * Defines an exit / die call - * @constructor Exit - * @extends {Statement} - * @property {Node|null} status - * @property {Boolean} useDie - */ -var Exit = Statement.extends(function Exit(status, useDie, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.status = status; - this.useDie = useDie; -}); - -module.exports = Exit; - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "eval"; - -/** - * Defines an eval statement - * @constructor Eval - * @extends {Statement} - * @property {Node} source - */ -var Eval = Statement.extends(function Eval(source, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.source = source; -}); - -module.exports = Eval; - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "error"; - -/** - * Defines an error node (used only on silentMode) - * @constructor Error - * @extends {Node} - * @property {string} message - * @property {number} line - * @property {number|string} token - * @property {string|array} expected - */ -var Error = Node.extends(function Error(message, token, line, expected, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.message = message; - this.token = token; - this.line = line; - this.expected = expected; -}); - -module.exports = Error; - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Node = __webpack_require__(1); -var KIND = "entry"; - -/** - * An array entry - see [Array](#array) - * @constructor Entry - * @extends {Node} - * @property {Node|null} key The entry key/offset - * @property {Node} value The entry value - */ -var Entry = Node.extends(function Entry(key, value, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.key = key; - this.value = value; -}); - -module.exports = Entry; - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Literal = __webpack_require__(4); -var KIND = "encapsed"; - -/** - * Defines an encapsed string (contains expressions) - * @constructor Encapsed - * @extends {Literal} - * @property {String} type - Defines the type of encapsed string (shell, heredoc, string) - * @property {String|Null} label - The heredoc label, defined only when the type is heredoc - */ -var Encapsed = Literal.extends(function Encapsed(value, raw, type, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); - this.type = type; -}); - -/** - * The node is a double quote string : - * ```php - * bar_$baz; - * ``` - * @constant {String} TYPE_OFFSET - `offset` - */ -Encapsed.TYPE_OFFSET = "offset"; - -module.exports = Encapsed; - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Sys = __webpack_require__(5); -var KIND = "empty"; - -/** - * Defines an empty check call - * @constructor Empty - * @extends {Sys} - */ -var Empty = Sys.extends(function Empty(args, docs, location) { - Sys.apply(this, [KIND, args, docs, location]); -}); - -module.exports = Empty; - -/***/ }), -/* 67 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Sys = __webpack_require__(5); -var KIND = "echo"; - -/** - * Defines system based call - * @constructor Echo - * @property {boolean} shortForm - * @extends {Sys} - */ -var Echo = Sys.extends(function Echo(args, shortForm, docs, location) { - Sys.apply(this, [KIND, args, docs, location]); - this.shortForm = shortForm; -}); - -module.exports = Echo; - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Statement = __webpack_require__(0); -var KIND = "do"; - -/** - * Defines a do/while statement - * @constructor Do - * @extends {Statement} - * @property {Expression} test - * @property {Statement} body - */ -var Do = Statement.extends(function Do(test, body, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.test = test; - this.body = body; -}); - -module.exports = Do; - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Block = __webpack_require__(8); -var KIND = "declare"; - -/** - * The declare construct is used to set execution directives for a block of code - * @constructor Declare - * @extends {Block} - * @property {Expression[]} what - * @property {String} mode - * @see http://php.net/manual/en/control-structures.declare.php - */ -var Declare = Block.extends(function Declare(what, body, mode, docs, location) { - Block.apply(this, [KIND, body, docs, location]); - this.what = what; - this.mode = mode; -}); - -/** - * The node is declared as a short tag syntax : - * ```php - * 'bar', 3] - * - * // AST structure : - * { - * "kind": "array", - * "shortForm": true - * "items": [ - * {"kind": "number", "value": "1"}, - * { - * "kind": "entry", - * "key": {"kind": "string", "value": "foo", "isDoubleQuote": false}, - * "value": {"kind": "string", "value": "bar", "isDoubleQuote": false} - * }, - * {"kind": "number", "value": "3"} - * ] - * } - * @extends {Expression} - * @property {Entry|Expr|Variable} items List of array items - * @property {boolean} shortForm Indicate if the short array syntax is used, ex `[]` instead `array()` - */ -var Array = Expr.extends(function Array(shortForm, items, docs, location) { - Expr.apply(this, [KIND, docs, location]); - this.items = items; - this.shortForm = shortForm; -}); - -module.exports = Array; - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -/** - * Each Position object consists of a line number (1-indexed) and a column number (0-indexed): - * @constructor Position - * @property {Number} line - * @property {Number} column - * @property {Number} offset - */ - -var Position = function Position(line, column, offset) { - this.line = line; - this.column = column; - this.offset = offset; -}; - -module.exports = Position; - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -/** - * Defines the location of the node (with it's source contents as string) - * @constructor Location - * @property {String|null} source - * @property {Position} start - * @property {Position} end - */ - -var Location = function Location(source, start, end) { - this.source = source; - this.start = start; - this.end = end; -}; - -module.exports = Location; - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var Location = __webpack_require__(88); -var Position = __webpack_require__(87); - -/** - * ## Class hierarchy - * - * - [Location](#location) - * - [Position](#position) - * - [Node](#node) - * - [Identifier](#identifier) - * - [TraitUse](#traituse) - * - [TraitAlias](#traitalias) - * - [TraitPrecedence](#traitprecedence) - * - [Entry](#entry) - * - [Case](#case) - * - [Label](#label) - * - [Comment](#comment) - * - [CommentLine](#commentline) - * - [CommentBlock](#commentblock) - * - [Error](#error) - * - [Expression](#expression) - * - [Array](#array) - * - [Variable](#variable) - * - [Variadic](#variadic) - * - [ConstRef](#constref) - * - [Yield](#yield) - * - [YieldFrom](#yieldfrom) - * - [Lookup](#lookup) - * - [PropertyLookup](#propertylookup) - * - [StaticLookup](#staticlookup) - * - [OffsetLookup](#offsetlookup) - * - [Operation](#operation) - * - [Pre](#pre) - * - [Post](#post) - * - [Bin](#bin) - * - [Unary](#unary) - * - [Cast](#cast) - * - [Literal](#literal) - * - [Boolean](#boolean) - * - [String](#string) - * - [Number](#number) - * - [Inline](#inline) - * - [Magic](#magic) - * - [Nowdoc](#nowdoc) - * - [Encapsed](#encapsed) - * - [Statement](#statement) - * - [Eval](#eval) - * - [Exit](#exit) - * - [Halt](#halt) - * - [Clone](#clone) - * - [Declare](#declare) - * - [Global](#global) - * - [Static](#static) - * - [Include](#include) - * - [Assign](#assign) - * - [RetIf](#retif) - * - [If](#if) - * - [Do](#do) - * - [While](#while) - * - [For](#for) - * - [Foreach](#foreach) - * - [Switch](#switch) - * - [Goto](#goto) - * - [Silent](#silent) - * - [Try](#try) - * - [Catch](#catch) - * - [Throw](#throw) - * - [Call](#call) - * - [Closure](#closure) - * - [New](#new) - * - [UseGroup](#usegroup) - * - [UseItem](#useitem) - * - [Block](#block) - * - [Program](#program) - * - [Namespace](#namespace) - * - [Sys](#sys) - * - [Echo](#echo) - * - [List](#list) - * - [Print](#print) - * - [Isset](#isset) - * - [Unset](#unset) - * - [Empty](#empty) - * - [Declaration](#declaration) - * - [Class](#class) - * - [Interface](#interface) - * - [Trait](#trait) - * - [Constant](#constant) - * - [ClassConstant](#classconstant) - * - [Function](#function) - * - [Method](#method) - * - [Parameter](#parameter) - * - [Property](#property) - * --- - */ - -/** - * The AST builder class - * @constructor AST - * @tutorial AST - * @property {Boolean} withPositions - Should locate any node (by default false) - * @property {Boolean} withSource - Should extract the node original code (by default false) - */ -var AST = function AST(withPositions, withSource) { - this.withPositions = withPositions; - this.withSource = withSource; -}; - -/** - * Create a position node from specified parser - * including it's lexer current state - * @param {Parser} - * @return {Position} - * @private - */ -AST.prototype.position = function (parser) { - return new Position(parser.lexer.yylloc.first_line, parser.lexer.yylloc.first_column, parser.lexer.yylloc.first_offset); -}; - -// operators in ascending order of precedence -AST.precedence = {}; -[["or"], ["xor"], ["and"], ["="], ["?"], ["??"], ["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "!=", "===", "!==", /* '<>', */"<=>"], ["<", "<=", ">", ">="], ["<<", ">>"], ["+", "-", "."], ["*", "/", "%"], ["!"], ["instanceof"] -// TODO: typecasts -// TODO: [ (array) -// TODO: clone, new -].forEach(function (list, index) { - list.forEach(function (operator) { - AST.precedence[operator] = index + 1; - }); -}); - -/** - * Check and fix precence, by default using right - */ -AST.prototype.resolvePrecedence = function (result) { - var buffer = void 0, - lLevel = void 0, - rLevel = void 0; - // handling precendence - if (result.kind === "bin") { - if (result.right && !result.right.parenthesizedExpression) { - if (result.right.kind === "bin") { - lLevel = AST.precedence[result.type]; - rLevel = AST.precedence[result.right.type]; - if (lLevel && rLevel && rLevel <= lLevel) { - // https://github.com/glayzzle/php-parser/issues/79 - // shift precedence - buffer = result.right; - result.right = result.right.left; - buffer.left = this.resolvePrecedence(result); - result = buffer; - } - } else if (result.right.kind === "retif") { - lLevel = AST.precedence[result.type]; - rLevel = AST.precedence["?"]; - if (lLevel && rLevel && rLevel <= lLevel) { - buffer = result.right; - result.right = result.right.test; - buffer.test = this.resolvePrecedence(result); - result = buffer; - } - } - } - } else if (result.kind === "unary") { - // https://github.com/glayzzle/php-parser/issues/75 - if (result.what && !result.what.parenthesizedExpression) { - // unary precedence is allways lower - if (result.what.kind === "bin") { - buffer = result.what; - result.what = result.what.left; - buffer.left = this.resolvePrecedence(result); - result = buffer; - } else if (result.what.kind === "retif") { - buffer = result.what; - result.what = result.what.test; - buffer.test = this.resolvePrecedence(result); - result = buffer; - } - } - } else if (result.kind === "retif") { - // https://github.com/glayzzle/php-parser/issues/77 - if (result.falseExpr && result.falseExpr.kind === "retif" && !result.falseExpr.parenthesizedExpression) { - buffer = result.falseExpr; - result.falseExpr = buffer.test; - buffer.test = this.resolvePrecedence(result); - result = buffer; - } - } else if (result.kind === "assign") { - // https://github.com/glayzzle/php-parser/issues/81 - if (result.right && result.right.kind === "bin" && !result.right.parenthesizedExpression) { - lLevel = AST.precedence["="]; - rLevel = AST.precedence[result.right.type]; - // only shifts with and, xor, or - if (lLevel && rLevel && rLevel < lLevel) { - buffer = result.right; - result.right = result.right.left; - buffer.left = result; - result = buffer; - } - } - } - return result; -}; - -/** - * Prepares an AST node - * @param {String|null} kind - Defines the node type - * (if null, the kind must be passed at the function call) - * @param {Parser} parser - The parser instance (use for extracting locations) - * @return {Function} - */ -AST.prototype.prepare = function (kind, docs, parser) { - var start = null; - if (this.withPositions || this.withSource) { - start = this.position(parser); - } - var self = this; - // returns the node - var result = function result() { - var location = null; - var args = Array.prototype.slice.call(arguments); - args.push(docs); - if (self.withPositions || self.withSource) { - var src = null; - if (self.withSource) { - src = parser.lexer._input.substring(start.offset, parser.prev[2]); - } - if (self.withPositions) { - location = new Location(src, start, new Position(parser.prev[0], parser.prev[1], parser.prev[2])); - } else { - location = new Location(src, null, null); - } - // last argument is allways the location - args.push(location); - } - // handle lazy kind definitions - if (!kind) { - kind = args.shift(); - } - // build the object - var node = self[kind]; - if (typeof node !== "function") { - throw new Error('Undefined node "' + kind + '"'); - } - var result = Object.create(node.prototype); - node.apply(result, args); - return self.resolvePrecedence(result); - }; - /** - * Helper to change a node kind - * @param {String} newKind - */ - result.setKind = function (newKind) { - kind = newKind; - }; - return result; -}; - -// Define all AST nodes -[__webpack_require__(86), __webpack_require__(85), __webpack_require__(84), __webpack_require__(8), __webpack_require__(83), __webpack_require__(82), __webpack_require__(81), __webpack_require__(80), __webpack_require__(79), __webpack_require__(78), __webpack_require__(77), __webpack_require__(76), __webpack_require__(75), __webpack_require__(74), __webpack_require__(9), __webpack_require__(73), __webpack_require__(72), __webpack_require__(11), __webpack_require__(71), __webpack_require__(70), __webpack_require__(3), __webpack_require__(69), __webpack_require__(68), __webpack_require__(67), __webpack_require__(66), __webpack_require__(65), __webpack_require__(64), __webpack_require__(63), __webpack_require__(62), __webpack_require__(61), __webpack_require__(2), __webpack_require__(60), __webpack_require__(59), __webpack_require__(10), __webpack_require__(58), __webpack_require__(57), __webpack_require__(56), __webpack_require__(55), __webpack_require__(54), __webpack_require__(53), __webpack_require__(52), __webpack_require__(51), __webpack_require__(50), __webpack_require__(49), __webpack_require__(48), __webpack_require__(4), __webpack_require__(7), __webpack_require__(47), __webpack_require__(46), __webpack_require__(45), __webpack_require__(44), __webpack_require__(1), __webpack_require__(43), __webpack_require__(42), __webpack_require__(41), __webpack_require__(6), __webpack_require__(40), __webpack_require__(39), __webpack_require__(38), __webpack_require__(37), __webpack_require__(36), __webpack_require__(35), __webpack_require__(34), __webpack_require__(33), __webpack_require__(32), __webpack_require__(31), __webpack_require__(0), __webpack_require__(30), __webpack_require__(29), __webpack_require__(28), __webpack_require__(27), __webpack_require__(5), __webpack_require__(26), __webpack_require__(25), __webpack_require__(24), __webpack_require__(23), __webpack_require__(22), __webpack_require__(21), __webpack_require__(20), __webpack_require__(19), __webpack_require__(18), __webpack_require__(17), __webpack_require__(16), __webpack_require__(15), __webpack_require__(14), __webpack_require__(13), __webpack_require__(12)].forEach(function (ctor) { - var kind = ctor.prototype.constructor.name.toLowerCase(); - if (kind[0] === "_") kind = kind.substring(1); - AST.prototype[kind] = ctor; -}); - -module.exports = AST; - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -/** - * PHP AST Tokens - * @type {Object} - */ - -module.exports = { - values: { - 101: "T_HALT_COMPILER", - 102: "T_USE", - 103: "T_ENCAPSED_AND_WHITESPACE", - 104: "T_OBJECT_OPERATOR", - 105: "T_STRING", - 106: "T_DOLLAR_OPEN_CURLY_BRACES", - 107: "T_STRING_VARNAME", - 108: "T_CURLY_OPEN", - 109: "T_NUM_STRING", - 110: "T_ISSET", - 111: "T_EMPTY", - 112: "T_INCLUDE", - 113: "T_INCLUDE_ONCE", - 114: "T_EVAL", - 115: "T_REQUIRE", - 116: "T_REQUIRE_ONCE", - 117: "T_NAMESPACE", - 118: "T_NS_SEPARATOR", - 119: "T_AS", - 120: "T_IF", - 121: "T_ENDIF", - 122: "T_WHILE", - 123: "T_DO", - 124: "T_FOR", - 125: "T_SWITCH", - 126: "T_BREAK", - 127: "T_CONTINUE", - 128: "T_RETURN", - 129: "T_GLOBAL", - 130: "T_STATIC", - 131: "T_ECHO", - 132: "T_INLINE_HTML", - 133: "T_UNSET", - 134: "T_FOREACH", - 135: "T_DECLARE", - 136: "T_TRY", - 137: "T_THROW", - 138: "T_GOTO", - 139: "T_FINALLY", - 140: "T_CATCH", - 141: "T_ENDDECLARE", - 142: "T_LIST", - 143: "T_CLONE", - 144: "T_PLUS_EQUAL", - 145: "T_MINUS_EQUAL", - 146: "T_MUL_EQUAL", - 147: "T_DIV_EQUAL", - 148: "T_CONCAT_EQUAL", - 149: "T_MOD_EQUAL", - 150: "T_AND_EQUAL", - 151: "T_OR_EQUAL", - 152: "T_XOR_EQUAL", - 153: "T_SL_EQUAL", - 154: "T_SR_EQUAL", - 155: "T_INC", - 156: "T_DEC", - 157: "T_BOOLEAN_OR", - 158: "T_BOOLEAN_AND", - 159: "T_LOGICAL_OR", - 160: "T_LOGICAL_AND", - 161: "T_LOGICAL_XOR", - 162: "T_SL", - 163: "T_SR", - 164: "T_IS_IDENTICAL", - 165: "T_IS_NOT_IDENTICAL", - 166: "T_IS_EQUAL", - 167: "T_IS_NOT_EQUAL", - 168: "T_IS_SMALLER_OR_EQUAL", - 169: "T_IS_GREATER_OR_EQUAL", - 170: "T_INSTANCEOF", - 171: "T_INT_CAST", - 172: "T_DOUBLE_CAST", - 173: "T_STRING_CAST", - 174: "T_ARRAY_CAST", - 175: "T_OBJECT_CAST", - 176: "T_BOOL_CAST", - 177: "T_UNSET_CAST", - 178: "T_EXIT", - 179: "T_PRINT", - 180: "T_YIELD", - 181: "T_YIELD_FROM", - 182: "T_FUNCTION", - 183: "T_DOUBLE_ARROW", - 184: "T_DOUBLE_COLON", - 185: "T_ARRAY", - 186: "T_CALLABLE", - 187: "T_CLASS", - 188: "T_ABSTRACT", - 189: "T_TRAIT", - 190: "T_FINAL", - 191: "T_EXTENDS", - 192: "T_INTERFACE", - 193: "T_IMPLEMENTS", - 194: "T_VAR", - 195: "T_PUBLIC", - 196: "T_PROTECTED", - 197: "T_PRIVATE", - 198: "T_CONST", - 199: "T_NEW", - 200: "T_INSTEADOF", - 201: "T_ELSEIF", - 202: "T_ELSE", - 203: "T_ENDSWITCH", - 204: "T_CASE", - 205: "T_DEFAULT", - 206: "T_ENDFOR", - 207: "T_ENDFOREACH", - 208: "T_ENDWHILE", - 209: "T_CONSTANT_ENCAPSED_STRING", - 210: "T_LNUMBER", - 211: "T_DNUMBER", - 212: "T_LINE", - 213: "T_FILE", - 214: "T_DIR", - 215: "T_TRAIT_C", - 216: "T_METHOD_C", - 217: "T_FUNC_C", - 218: "T_NS_C", - 219: "T_START_HEREDOC", - 220: "T_END_HEREDOC", - 221: "T_CLASS_C", - 222: "T_VARIABLE", - 223: "T_OPEN_TAG", - 224: "T_OPEN_TAG_WITH_ECHO", - 225: "T_CLOSE_TAG", - 226: "T_WHITESPACE", - 227: "T_COMMENT", - 228: "T_DOC_COMMENT", - 229: "T_ELLIPSIS", - 230: "T_COALESCE", - 231: "T_POW", - 232: "T_POW_EQUAL", - 233: "T_SPACESHIP" - }, - names: { - T_HALT_COMPILER: 101, - T_USE: 102, - T_ENCAPSED_AND_WHITESPACE: 103, - T_OBJECT_OPERATOR: 104, - T_STRING: 105, - T_DOLLAR_OPEN_CURLY_BRACES: 106, - T_STRING_VARNAME: 107, - T_CURLY_OPEN: 108, - T_NUM_STRING: 109, - T_ISSET: 110, - T_EMPTY: 111, - T_INCLUDE: 112, - T_INCLUDE_ONCE: 113, - T_EVAL: 114, - T_REQUIRE: 115, - T_REQUIRE_ONCE: 116, - T_NAMESPACE: 117, - T_NS_SEPARATOR: 118, - T_AS: 119, - T_IF: 120, - T_ENDIF: 121, - T_WHILE: 122, - T_DO: 123, - T_FOR: 124, - T_SWITCH: 125, - T_BREAK: 126, - T_CONTINUE: 127, - T_RETURN: 128, - T_GLOBAL: 129, - T_STATIC: 130, - T_ECHO: 131, - T_INLINE_HTML: 132, - T_UNSET: 133, - T_FOREACH: 134, - T_DECLARE: 135, - T_TRY: 136, - T_THROW: 137, - T_GOTO: 138, - T_FINALLY: 139, - T_CATCH: 140, - T_ENDDECLARE: 141, - T_LIST: 142, - T_CLONE: 143, - T_PLUS_EQUAL: 144, - T_MINUS_EQUAL: 145, - T_MUL_EQUAL: 146, - T_DIV_EQUAL: 147, - T_CONCAT_EQUAL: 148, - T_MOD_EQUAL: 149, - T_AND_EQUAL: 150, - T_OR_EQUAL: 151, - T_XOR_EQUAL: 152, - T_SL_EQUAL: 153, - T_SR_EQUAL: 154, - T_INC: 155, - T_DEC: 156, - T_BOOLEAN_OR: 157, - T_BOOLEAN_AND: 158, - T_LOGICAL_OR: 159, - T_LOGICAL_AND: 160, - T_LOGICAL_XOR: 161, - T_SL: 162, - T_SR: 163, - T_IS_IDENTICAL: 164, - T_IS_NOT_IDENTICAL: 165, - T_IS_EQUAL: 166, - T_IS_NOT_EQUAL: 167, - T_IS_SMALLER_OR_EQUAL: 168, - T_IS_GREATER_OR_EQUAL: 169, - T_INSTANCEOF: 170, - T_INT_CAST: 171, - T_DOUBLE_CAST: 172, - T_STRING_CAST: 173, - T_ARRAY_CAST: 174, - T_OBJECT_CAST: 175, - T_BOOL_CAST: 176, - T_UNSET_CAST: 177, - T_EXIT: 178, - T_PRINT: 179, - T_YIELD: 180, - T_YIELD_FROM: 181, - T_FUNCTION: 182, - T_DOUBLE_ARROW: 183, - T_DOUBLE_COLON: 184, - T_ARRAY: 185, - T_CALLABLE: 186, - T_CLASS: 187, - T_ABSTRACT: 188, - T_TRAIT: 189, - T_FINAL: 190, - T_EXTENDS: 191, - T_INTERFACE: 192, - T_IMPLEMENTS: 193, - T_VAR: 194, - T_PUBLIC: 195, - T_PROTECTED: 196, - T_PRIVATE: 197, - T_CONST: 198, - T_NEW: 199, - T_INSTEADOF: 200, - T_ELSEIF: 201, - T_ELSE: 202, - T_ENDSWITCH: 203, - T_CASE: 204, - T_DEFAULT: 205, - T_ENDFOR: 206, - T_ENDFOREACH: 207, - T_ENDWHILE: 208, - T_CONSTANT_ENCAPSED_STRING: 209, - T_LNUMBER: 210, - T_DNUMBER: 211, - T_LINE: 212, - T_FILE: 213, - T_DIR: 214, - T_TRAIT_C: 215, - T_METHOD_C: 216, - T_FUNC_C: 217, - T_NS_C: 218, - T_START_HEREDOC: 219, - T_END_HEREDOC: 220, - T_CLASS_C: 221, - T_VARIABLE: 222, - T_OPEN_TAG: 223, - T_OPEN_TAG_WITH_ECHO: 224, - T_CLOSE_TAG: 225, - T_WHITESPACE: 226, - T_COMMENT: 227, - T_DOC_COMMENT: 228, - T_ELLIPSIS: 229, - T_COALESCE: 230, - T_POW: 231, - T_POW_EQUAL: 232, - T_SPACESHIP: 233 - } -}; - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * Reads a variable - * - * ```ebnf - * variable ::= &? ...complex @todo - * ``` - * - * Some samples of parsed code : - * ```php - * &$var // simple var - * $var // simple var - * classname::CONST_NAME // dynamic class name with const retrieval - * foo() // function call - * $var->func()->property // chained calls - * ``` - */ - read_variable: function read_variable(read_only, encapsed, byref) { - var result = void 0; - - // check the byref flag - if (!byref && this.token === "&") { - byref = true; - this.next(); - } - - // reads the entry point - if (this.is([this.tok.T_VARIABLE, "$"])) { - result = this.read_reference_variable(encapsed, byref); - } else if (this.is([this.tok.T_NS_SEPARATOR, this.tok.T_STRING, this.tok.T_NAMESPACE])) { - result = this.node(); - var name = this.read_namespace_name(); - if (this.token != this.tok.T_DOUBLE_COLON && this.token != "(") { - // @see parser.js line 130 : resolves a conflict with scalar - var literal = name.name.toLowerCase(); - if (literal === "true") { - result = result("boolean", true, name.name); - } else if (literal === "false") { - result = result("boolean", false, name.name); - } else { - // @todo null keyword ? - result = result("constref", name); - } - } else { - result = name; - } - } else if (this.token === this.tok.T_STATIC) { - result = this.node("constref"); - this.next(); - result = result("static"); - } else { - this.expect("VARIABLE"); - } - - // static mode - if (this.token === this.tok.T_DOUBLE_COLON) { - result = this.read_static_getter(result, encapsed); - } - - return this.recursive_variable_chain_scan(result, read_only, encapsed); - }, - - // resolves a static call - read_static_getter: function read_static_getter(what, encapsed) { - var result = this.node("staticlookup"); - var offset = void 0, - name = void 0; - if (this.next().is([this.tok.T_VARIABLE, "$"])) { - offset = this.read_reference_variable(encapsed, false); - } else if (this.token === this.tok.T_STRING || this.token === this.tok.T_CLASS || this.php7 && this.is("IDENTIFIER")) { - offset = this.node("constref"); - name = this.text(); - this.next(); - offset = offset(name); - } else { - this.error([this.tok.T_VARIABLE, this.tok.T_STRING]); - // graceful mode : set getter as error node and continue - offset = this.node("constref"); - name = this.text(); - this.next(); - offset = offset(name); - } - return result(what, offset); - }, - - recursive_variable_chain_scan: function recursive_variable_chain_scan(result, read_only, encapsed) { - var name = void 0, - node = void 0, - offset = void 0; - recursive_scan_loop: while (this.token != this.EOF) { - switch (this.token) { - case "(": - if (read_only) { - // @fixme : add more informations & test - return result; - } else { - result = this.node("call")(result, this.read_function_argument_list()); - } - break; - case "[": - node = this.node("offsetlookup"); - this.next(); - offset = false; - if (encapsed) { - offset = this.read_encaps_var_offset(); - this.expect("]") && this.next(); - } else { - // callable_variable : https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L1122 - if (this.token !== "]") { - offset = this.read_expr(); - this.expect("]") && this.next(); - } else { - this.next(); - } - } - result = node(result, offset); - break; - case this.tok.T_DOUBLE_COLON: - // @see https://github.com/glayzzle/php-parser/issues/107#issuecomment-354104574 - if (result.kind === "staticlookup") { - this.error(); - } - - node = this.node("staticlookup"); - if (this.next().token === this.tok.T_STRING || this.php7 && this.is("IDENTIFIER")) { - offset = this.node("constref"); - name = this.text(); - this.next(); - offset = offset(name); - - if (this.token === this.tok.T_OBJECT_OPERATOR) { - this.error(); - } - } else { - this.error(this.tok.T_STRING); - // fallback on a constref node - offset = this.node("constref")(this.text()); - this.next(); - } - result = node(result, offset); - break; - case this.tok.T_OBJECT_OPERATOR: - { - node = this.node("propertylookup"); - var what = null; - switch (this.next().token) { - case this.tok.T_STRING: - what = this.node("constref"); - name = this.text(); - this.next(); - what = what(name); - if (this.token === this.tok.T_VARIABLE) { - var inner = this.node("variable"); - name = this.text().substring(1); - this.next(); - what = this.node("encapsed")([what, inner(name, false, false)], null, "offset"); - if (what.loc && what.value[0].loc) { - what.loc.start = what.value[0].loc.start; - } - } else if (this.token === "{") { - var expr = this.next().read_expr(); - this.expect("}") && this.next(); - what = this.node("encapsed")([what, expr], null, "offset"); - if (what.loc && what.value[0].loc) { - what.loc.start = what.value[0].loc.start; - } - } - break; - case this.tok.T_VARIABLE: - what = this.node("variable"); - name = this.text().substring(1); - this.next(); - what = what(name, false, false); - break; - case "$": - this.next().expect(["{", this.tok.T_VARIABLE]); - if (this.token === "{") { - // $obj->${$varname} - what = this.next().read_expr(); - this.expect("}") && this.next(); - } else { - // $obj->$$varname - what = this.read_expr(); - } - break; - case "{": - what = this.next().read_expr(); - this.expect("}") && this.next(); - break; - default: - this.error([this.tok.T_STRING, this.tok.T_VARIABLE]); - // graceful mode : set what as error mode & continue - what = this.node("constref"); - name = this.text(); - this.next(); - what = what(name); - break; - } - result = node(result, what); - break; - } - default: - break recursive_scan_loop; - } - } - return result; - }, - /** - * https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L1231 - */ - read_encaps_var_offset: function read_encaps_var_offset() { - var offset = this.node(); - if (this.token === this.tok.T_STRING) { - var text = this.text(); - this.next(); - offset = offset("constref", text); - } else if (this.token === this.tok.T_NUM_STRING) { - var num = this.text(); - this.next(); - offset = offset("number", num, null); - } else if (this.token === this.tok.T_VARIABLE) { - var name = this.text().substring(1); - this.next(); - offset = offset("variable", name, false, false); - } else { - this.expect([this.tok.T_STRING, this.tok.T_NUM_STRING, this.tok.T_VARIABLE]); - // fallback : consider as constref - var _text = this.text(); - this.next(); - offset = offset("constref", _text); - } - return offset; - }, - /** - * ```ebnf - * reference_variable ::= simple_variable ('[' OFFSET ']')* | '{' EXPR '}' - * ``` - * - * $foo[123]; // foo is an array ==> gets its entry - * $foo{1}; // foo is a string ==> get the 2nd char offset - * ${'foo'}[123]; // get the dynamic var $foo - * $foo[123]{1}; // gets the 2nd char from the 123 array entry - * - */ - read_reference_variable: function read_reference_variable(encapsed, byref) { - var result = this.read_simple_variable(byref); - var offset = void 0; - while (this.token != this.EOF) { - var node = this.node(); - if (this.token == "[") { - offset = null; - if (encapsed) { - offset = this.next().read_encaps_var_offset(); - } else { - offset = this.next().token === "]" ? null : this.read_dim_offset(); - } - this.expect("]") && this.next(); - result = node("offsetlookup", result, offset); - } else if (this.token == "{" && !encapsed) { - offset = this.next().read_expr(); - this.expect("}") && this.next(); - result = node("offsetlookup", result, offset); - } else break; - } - return result; - }, - /** - * ```ebnf - * simple_variable ::= T_VARIABLE | '$' '{' expr '}' | '$' simple_variable - * ``` - */ - read_simple_variable: function read_simple_variable(byref) { - var result = this.node("variable"); - var name = void 0; - if (this.expect([this.tok.T_VARIABLE, "$"]) && this.token === this.tok.T_VARIABLE) { - // plain variable name - name = this.text().substring(1); - this.next(); - result = result(name, byref, false); - } else { - if (this.token === "$") this.next(); - // dynamic variable name - switch (this.token) { - case "{": - { - var expr = this.next().read_expr(); - this.expect("}") && this.next(); - result = result(expr, byref, true); - break; - } - case "$": - // $$$var - result = result(this.read_simple_variable(false), byref); - break; - case this.tok.T_VARIABLE: - { - // $$var - name = this.text().substring(1); - var node = this.node("variable"); - this.next(); - result = result(node(name, false, false), byref, false); - break; - } - default: - this.error(["{", "$", this.tok.T_VARIABLE]); - // graceful mode - name = this.text(); - this.next(); - result = result(name, byref, false); - } - } - return result; - } -}; - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * Reads a short form of tokens - * @param {Number} token - The ending token - * @return {Block} - */ - read_short_form: function read_short_form(token) { - var body = this.node("block"); - var items = []; - if (this.expect(":")) this.next(); - while (this.token != this.EOF && this.token !== token) { - items.push(this.read_inner_statement()); - } - if (this.expect(token)) this.next(); - this.expectEndOfStatement(); - return body(null, items); - }, - - /** - * Helper : reads a list of tokens / sample : T_STRING ',' T_STRING ... - * ```ebnf - * list ::= separator? ( item separator )* item - * ``` - */ - read_list: function read_list(item, separator, preserveFirstSeparator) { - var result = []; - - if (this.token == separator) { - if (preserveFirstSeparator) result.push(null); - this.next(); - } - - if (typeof item === "function") { - do { - result.push(item.apply(this, [])); - if (this.token != separator) { - break; - } - } while (this.next().token != this.EOF); - } else { - if (this.expect(item)) { - result.push(this.text()); - } else { - return []; - } - while (this.next().token != this.EOF) { - if (this.token != separator) break; - // trim current separator & check item - if (this.next().token != item) break; - result.push(this.text()); - } - } - return result; - }, - - /** - * Reads a list of names separated by a comma - * - * ```ebnf - * name_list ::= namespace (',' namespace)* - * ``` - * - * Sample code : - * ```php - * 0 ? body(null, items) : null); - } -}; - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * reading a list of top statements (helper for top_statement*) - * ```ebnf - * top_statements ::= top_statement* - * ``` - */ - read_top_statements: function read_top_statements() { - var result = []; - while (this.token !== this.EOF && this.token !== "}") { - var statement = this.read_top_statement(); - if (statement) { - if (Array.isArray(statement)) { - result = result.concat(statement); - } else { - result.push(statement); - } - } - } - return result; - }, - /** - * reading a top statement - * ```ebnf - * top_statement ::= - * namespace | function | class - * | interface | trait - * | use_statements | const_list - * | statement - * ``` - */ - read_top_statement: function read_top_statement() { - switch (this.token) { - case this.tok.T_FUNCTION: - return this.read_function(false, false); - // optional flags - case this.tok.T_ABSTRACT: - case this.tok.T_FINAL: - { - var flag = this.read_class_scope(); - if (this.token === this.tok.T_CLASS) { - return this.read_class(flag); - } else { - this.error(this.tok.T_CLASS); - this.next(); - return null; - } - } - case this.tok.T_CLASS: - return this.read_class([0, 0, 0]); - case this.tok.T_INTERFACE: - return this.read_interface(); - case this.tok.T_TRAIT: - return this.read_trait(); - case this.tok.T_USE: - return this.read_use_statement(); - case this.tok.T_CONST: - return this.next().read_const_list(); - case this.tok.T_NAMESPACE: - return this.read_namespace(); - case this.tok.T_HALT_COMPILER: - { - var result = this.node("halt"); - if (this.next().expect("(")) this.next(); - if (this.expect(")")) this.next(); - this.expect(";"); - this.lexer.done = true; - return result(this.lexer._input.substring(this.lexer.offset)); - } - default: - return this.read_statement(); - } - }, - /** - * reads a list of simple inner statements (helper for inner_statement*) - * ```ebnf - * inner_statements ::= inner_statement* - * ``` - */ - read_inner_statements: function read_inner_statements() { - var result = []; - while (this.token != this.EOF && this.token !== "}") { - var statement = this.read_inner_statement(); - if (statement) { - if (Array.isArray(statement)) { - result = result.concat(statement); - } else { - result.push(statement); - } - } - } - return result; - }, - /** - * Reads a list of constants declaration - * ```ebnf - * const_list ::= T_CONST T_STRING '=' expr (',' T_STRING '=' expr)* ';' - * ``` - */ - read_const_list: function read_const_list() { - var result = this.read_list(function () { - this.expect(this.tok.T_STRING); - var result = this.node("constant"); - var name = this.text(); - if (this.next().expect("=")) { - return result(name, this.next().read_expr()); - } else { - // fallback - return result(name, null); - } - }, ",", false); - this.expectEndOfStatement(); - return result; - }, - /** - * Reads a list of constants declaration - * ```ebnf - * declare_list ::= T_STRING '=' expr (',' T_STRING '=' expr)* - * ``` - * @retrurn {Object} - */ - read_declare_list: function read_declare_list() { - var result = {}; - while (this.token != this.EOF && this.token !== ")") { - this.expect(this.tok.T_STRING); - var name = this.text().toLowerCase(); - if (this.next().expect("=")) { - result[name] = this.next().read_expr(); - } else { - result[name] = null; - } - if (this.token !== ",") break; - this.next(); - } - return result; - }, - /** - * reads a simple inner statement - * ```ebnf - * inner_statement ::= '{' inner_statements '}' | token - * ``` - */ - read_inner_statement: function read_inner_statement() { - switch (this.token) { - case this.tok.T_FUNCTION: - return this.read_function(false, false); - // optional flags - case this.tok.T_ABSTRACT: - case this.tok.T_FINAL: - { - var flag = this.read_class_scope(); - if (this.token === this.tok.T_CLASS) { - return this.read_class(flag); - } else { - this.error(this.tok.T_CLASS); - // graceful mode : ignore token & go next - this.next(); - return null; - } - } - case this.tok.T_CLASS: - return this.read_class([0, 0, 0]); - case this.tok.T_INTERFACE: - return this.read_interface(); - case this.tok.T_TRAIT: - return this.read_trait(); - case this.tok.T_HALT_COMPILER: - { - this.raiseError("__HALT_COMPILER() can only be used from the outermost scope"); - // fallback : returns a node but does not stop the parsing - var node = this.node("halt"); - this.next().expect("(") && this.next(); - this.expect(")") && this.next(); - node = node(this.lexer._input.substring(this.lexer.offset)); - this.expect(";") && this.next(); - return node; - } - default: - return this.read_statement(); - } - }, - /** - * Reads statements - */ - read_statement: function read_statement() { - var result = void 0, - expr = void 0, - items = void 0, - current = void 0, - label = void 0; - switch (this.token) { - case "{": - return this.read_code_block(false); - - case this.tok.T_IF: - return this.read_if(); - - case this.tok.T_SWITCH: - return this.read_switch(); - - case this.tok.T_FOR: - return this.next().read_for(); - - case this.tok.T_FOREACH: - return this.next().read_foreach(); - - case this.tok.T_WHILE: - return this.next().read_while(); - - case this.tok.T_DO: - return this.next().read_do(); - - case this.tok.T_COMMENT: - return this.read_comment(); - - case this.tok.T_DOC_COMMENT: - return this.read_doc_comment(); - - case this.tok.T_RETURN: - result = this.node("return"); - expr = null; - if (!this.next().is("EOS")) { - expr = this.read_expr(); - } - this.expectEndOfStatement(); - return result(expr); - - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L429 - case this.tok.T_BREAK: - case this.tok.T_CONTINUE: - { - result = this.node(this.token === this.tok.T_CONTINUE ? "continue" : "break"); - var level = null; - this.next(); // look ahead - if (this.token !== ";") { - level = this.read_expr(); - } - this.expectEndOfStatement(); - return result(level); - } - - case this.tok.T_GLOBAL: - result = this.node("global"); - items = this.next().read_list(this.read_simple_variable, ","); - this.expectEndOfStatement(); - return result(items); - - case this.tok.T_STATIC: - current = [this.token, this.lexer.getState()]; - result = this.node("static"); - if (this.next().token === this.tok.T_DOUBLE_COLON) { - // static keyword for a class - this.lexer.tokens.push(current); - expr = this.next().read_expr(); - this.expect(";") && this.next(); - return expr; - } - if (this.token === this.tok.T_FUNCTION) { - return this.read_function(true, [0, 1, 0]); - } - items = this.read_variable_declarations(); - this.expectEndOfStatement(); - return result(items); - - case this.tok.T_ECHO: - { - result = this.node("echo"); - var text = this.text(); - var shortForm = text === " 0 ? this.lexer._input[this.lexer.yylloc.first_offset - 1] : null; - var fixFirstLine = prevChar === "\r" || prevChar === "\n"; - // revert back the first stripped line - if (fixFirstLine) { - if (prevChar === "\n" && this.lexer.yylloc.first_offset > 1 && this.lexer._input[this.lexer.yylloc.first_offset - 2] === "\r") { - prevChar = "\r\n"; - } - } - result = this.node("inline"); - this.next(); - return result(value, fixFirstLine ? prevChar + value : value); - } - - case this.tok.T_UNSET: - result = this.node("unset"); - this.next().expect("(") && this.next(); - items = this.read_list(this.read_variable, ","); - this.expect(")") && this.next(); - this.expect(";") && this.next(); - return result(items); - - case this.tok.T_DECLARE: - { - result = this.node("declare"); - var body = []; - var mode = void 0; - this.next().expect("(") && this.next(); - var what = this.read_declare_list(); - this.expect(")") && this.next(); - if (this.token === ":") { - this.next(); - while (this.token != this.EOF && this.token !== this.tok.T_ENDDECLARE) { - // @todo : check declare_statement from php / not valid - body.push(this.read_top_statement()); - } - this.expect(this.tok.T_ENDDECLARE) && this.next(); - this.expectEndOfStatement(); - mode = this.ast.declare.MODE_SHORT; - } else if (this.token === "{") { - this.next(); - while (this.token != this.EOF && this.token !== "}") { - // @todo : check declare_statement from php / not valid - body.push(this.read_top_statement()); - } - this.expect("}") && this.next(); - mode = this.ast.declare.MODE_BLOCK; - } else { - this.expect(";") && this.next(); - mode = this.ast.declare.MODE_NONE; - } - return result(what, body, mode); - } - - case this.tok.T_TRY: - return this.read_try(); - - case this.tok.T_THROW: - result = this.node("throw"); - expr = this.next().read_expr(); - this.expectEndOfStatement(); - return result(expr); - - case ";": - // ignore this (extra ponctuation) - this.next(); - return null; - - case this.tok.T_STRING: - current = [this.token, this.lexer.getState()]; - label = this.text(); - // AST : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L457 - if (this.next().token === ":") { - result = this.node("label"); - this.next(); - return result(label); - } - - // default fallback expr / T_STRING '::' (etc...) - this.lexer.tokens.push(current); - expr = this.next().read_expr(); - this.expectEndOfStatement(); - return expr; - - case this.tok.T_GOTO: - result = this.node("goto"); - label = null; - if (this.next().expect(this.tok.T_STRING)) { - label = this.text(); - this.next().expectEndOfStatement(); - } - return result(label); - - default: - // default fallback expr - expr = this.read_expr(); - this.expectEndOfStatement(expr); - return expr; - } - }, - /** - * ```ebnf - * code_block ::= '{' (inner_statements | top_statements) '}' - * ``` - */ - read_code_block: function read_code_block(top) { - var result = this.node("block"); - this.expect("{") && this.next(); - var body = top ? this.read_top_statements() : this.read_inner_statements(); - this.expect("}") && this.next(); - return result(null, body); - } -}; - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var specialChar = { - "\\r": "\r", - "\\n": "\n", - "\\t": "\t", - "\\v": String.fromCharCode(11), - "\\e": String.fromCharCode(27), - "\\f": String.fromCharCode(12), - "\\\\": "\\", - "\\$": "$", - '\\"': '"', - "\\'": "'" -}; - -module.exports = { - /** - * Unescape special chars - */ - resolve_special_chars: function resolve_special_chars(text, doubleQuote) { - if (!doubleQuote) { - // single quote fix - return text.replace(/\\['\\]/g, function (seq) { - return specialChar[seq]; - }); - } - return text.replace(/\\[rntvef"'\\$]/g, function (seq) { - return specialChar[seq]; - }); - }, - /** - * ```ebnf - * scalar ::= T_MAGIC_CONST - * | T_LNUMBER | T_DNUMBER - * | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE? T_END_HEREDOC - * | '"' encaps_list '"' - * | T_START_HEREDOC encaps_list T_END_HEREDOC - * | namespace_name (T_DOUBLE_COLON T_STRING)? - * ``` - */ - read_scalar: function read_scalar() { - if (this.is("T_MAGIC_CONST")) { - return this.get_magic_constant(); - } else { - var value = void 0, - node = void 0; - switch (this.token) { - // TEXTS - case this.tok.T_CONSTANT_ENCAPSED_STRING: - { - value = this.node("string"); - var text = this.text(); - var offset = 0; - if (text[0] === "b" || text[0] === "B") { - offset = 1; - } - var isDoubleQuote = text[offset] === '"'; - this.next(); - value = value(isDoubleQuote, this.resolve_special_chars(text.substring(offset + 1, text.length - 1), isDoubleQuote), offset === 1, // unicode flag - text); - if (this.token === this.tok.T_DOUBLE_COLON) { - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1151 - return this.read_static_getter(value); - } else { - // dirrect string - return value; - } - } - case this.tok.T_START_HEREDOC: - if (this.lexer.curCondition === "ST_NOWDOC") { - var start = this.lexer.yylloc.first_offset; - node = this.node("nowdoc"); - value = this.next().text(); - // strip the last line return char - var lastCh = value[value.length - 1]; - if (lastCh === "\n") { - if (value[value.length - 2] === "\r") { - // windows style - value = value.substring(0, value.length - 2); - } else { - // linux style - value = value.substring(0, value.length - 1); - } - } else if (lastCh === "\r") { - // mac style - value = value.substring(0, value.length - 1); - } - this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE) && this.next(); - var raw = this.lexer._input.substring(start, this.lexer.yylloc.last_offset); - node = node(value, raw, this.lexer.heredoc_label, raw[3] === '"' || raw[3] === "'"); - this.expect(this.tok.T_END_HEREDOC) && this.next(); - return node; - } else { - return this.next().read_encapsed_string(this.tok.T_END_HEREDOC); - } - - case '"': - return this.next().read_encapsed_string('"'); - - case 'b"': - case 'B"': - { - this.next(); - this.lexer.yylloc.prev_offset -= 1; - return this.read_encapsed_string('"'); - } - - // NUMERIC - case this.tok.T_LNUMBER: // long - case this.tok.T_DNUMBER: - { - // double - var result = this.node("number"); - value = this.text(); - this.next(); - return result(value, null); - } - - // ARRAYS - case this.tok.T_ARRAY: - // array parser - return this.read_array(); - case "[": - // short array format - return this.read_array(); - default: - { - var err = this.error("SCALAR"); - // graceful mode : ignore token & return error node - this.next(); - return err; - } - } - } - }, - /** - * Handles the dereferencing - */ - read_dereferencable: function read_dereferencable(expr) { - var result = void 0, - offset = void 0; - var node = this.node("offsetlookup"); - if (this.token === "[") { - offset = this.next().read_expr(); - if (this.expect("]")) this.next(); - result = node(expr, offset); - } else if (this.token === this.tok.T_DOLLAR_OPEN_CURLY_BRACES) { - offset = this.read_encapsed_string_item(false); - result = node(expr, offset); - } - return result; - }, - /** - * Reads and extracts an encapsed item - * ```ebnf - * encapsed_string_item ::= T_ENCAPSED_AND_WHITESPACE - * | T_DOLLAR_OPEN_CURLY_BRACES expr '}' - * | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' - * | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' - * | T_CURLY_OPEN variable '}' - * | variable - * | variable '[' expr ']' - * | variable T_OBJECT_OPERATOR T_STRING - * ``` - * @return {String|Variable|Expr|Lookup} - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1219 - */ - read_encapsed_string_item: function read_encapsed_string_item(isDoubleQuote) { - var result = this.node(), - offset = void 0, - node = void 0, - name = void 0; - - // plain text - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1222 - if (this.token === this.tok.T_ENCAPSED_AND_WHITESPACE) { - var text = this.text(); - this.next(); - result = result("string", false, this.resolve_special_chars(text, isDoubleQuote), false, text); - } else if (this.token === this.tok.T_DOLLAR_OPEN_CURLY_BRACES) { - // dynamic variable name - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1239 - name = null; - if (this.next().token === this.tok.T_STRING_VARNAME) { - var varName = this.text(); - name = this.node("variable"); - this.next(); - // check if lookup an offset - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1243 - if (this.token === "[") { - name = name(varName, false); - node = this.node("offsetlookup"); - offset = this.next().read_expr(); - this.expect("]") && this.next(); - name = node(name, offset); - } else { - name = this.node("constref")(varName); - } - } else { - name = this.read_expr(); - } - this.expect("}") && this.next(); - result = result("variable", name, false, true); - } else if (this.token === this.tok.T_CURLY_OPEN) { - // expression - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1246 - result = this.next().read_variable(false, false, false); - if (result.kind === "variable") { - result.curly = true; - } - this.expect("}") && this.next(); - } else if (this.token === this.tok.T_VARIABLE) { - // plain variable - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1231 - result = this.read_simple_variable(false); - - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1233 - if (this.token === "[") { - node = this.node("offsetlookup"); - offset = this.next().read_encaps_var_offset(); - this.expect("]") && this.next(); - result = node(result, offset); - } - - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1236 - if (this.token === this.tok.T_OBJECT_OPERATOR) { - node = this.node("propertylookup"); - var what = this.node("constref"); - this.next().expect(this.tok.T_STRING); - name = this.text(); - this.next(); - result = node(result, what(name)); - } - - // error / fallback - } else { - this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE); - var value = this.text(); - this.next(); - // consider it as string - result = result("string", false, value, false, value); - } - - return result; - }, - /** - * Reads an encapsed string - */ - read_encapsed_string: function read_encapsed_string(expect) { - var start = this.lexer.yylloc.prev_offset; - var node = this.node("encapsed"); - var value = []; - var type = null; - - if (expect === "`") { - type = this.ast.encapsed.TYPE_SHELL; - } else if (expect === '"') { - type = this.ast.encapsed.TYPE_STRING; - } else { - type = this.ast.encapsed.TYPE_HEREDOC; - } - - // reading encapsed parts - while (this.token !== expect && this.token !== this.EOF) { - value.push(this.read_encapsed_string_item(true)); - } - - this.expect(expect) && this.next(); - node = node(value, this.lexer._input.substring(start - 1, this.lexer.yylloc.first_offset), type); - - if (expect === this.tok.T_END_HEREDOC) { - node.label = this.lexer.heredoc_label; - } - return node; - }, - /** - * Constant token - */ - get_magic_constant: function get_magic_constant() { - var result = this.node("magic"); - var name = this.text(); - this.next(); - return result(name.toUpperCase(), name); - } -}; - -/***/ }), -/* 97 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * Reads a namespace declaration block - * ```ebnf - * namespace ::= T_NAMESPACE namespace_name? '{' - * top_statements - * '}' - * | T_NAMESPACE namespace_name ';' top_statements - * ``` - * @see http://php.net/manual/en/language.namespaces.php - * @return {Namespace} - */ - read_namespace: function read_namespace() { - var result = this.node("namespace"); - var body = void 0; - this.expect(this.tok.T_NAMESPACE) && this.next(); - if (this.token == "{") { - this.currentNamespace = [""]; - body = this.next().read_top_statements(); - this.expect("}") && this.next(); - return result([""], body, true); - } else { - var name = this.read_namespace_name(); - if (this.token == ";") { - this.currentNamespace = name; - body = this.next().read_top_statements(); - this.expect(this.EOF); - return result(name.name, body, false); - } else if (this.token == "{") { - this.currentNamespace = name; - body = this.next().read_top_statements(); - this.expect("}") && this.next(); - return result(name.name, body, true); - } else if (this.token === "(") { - // resolve ambuiguity between namespace & function call - name.resolution = this.ast.identifier.RELATIVE_NAME; - name.name = name.name.substring(1); - return this.node("call")(name, this.read_function_argument_list()); - } else { - this.error(["{", ";"]); - // graceful mode : - this.currentNamespace = name; - body = this.read_top_statements(); - this.expect(this.EOF); - return result(name, body, false); - } - } - }, - /** - * Reads a namespace name - * ```ebnf - * namespace_name ::= T_NS_SEPARATOR? (T_STRING T_NS_SEPARATOR)* T_STRING - * ``` - * @see http://php.net/manual/en/language.namespaces.rules.php - * @return {Identifier} - */ - read_namespace_name: function read_namespace_name() { - var result = this.node("identifier"); - var relative = false; - if (this.token === this.tok.T_NAMESPACE) { - this.next().expect(this.tok.T_NS_SEPARATOR) && this.next(); - relative = true; - } - return result(this.read_list(this.tok.T_STRING, this.tok.T_NS_SEPARATOR, true), relative); - }, - /** - * Reads a use statement - * ```ebnf - * use_statement ::= T_USE - * use_type? use_declarations | - * use_type use_statement '{' use_declarations '}' | - * use_statement '{' use_declarations(=>typed) '}' - * ';' - * ``` - * @see http://php.net/manual/en/language.namespaces.importing.php - * @return {UseGroup} - */ - read_use_statement: function read_use_statement() { - var result = this.node("usegroup"); - var items = []; - var name = null; - this.expect(this.tok.T_USE) && this.next(); - var type = this.read_use_type(); - items.push(this.read_use_declaration(false)); - if (this.token === ",") { - items = items.concat(this.next().read_use_declarations(false)); - } else if (this.token === "{") { - name = items[0].name; - items = this.next().read_use_declarations(type === null); - this.expect("}") && this.next(); - } - result = result(name, type, items); - this.expect(";") && this.next(); - return result; - }, - /** - * Reads a use declaration - * ```ebnf - * use_declaration ::= use_type? namespace_name use_alias - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L380 - * @return {UseItem} - */ - read_use_declaration: function read_use_declaration(typed) { - var result = this.node("useitem"); - var type = null; - if (typed) type = this.read_use_type(); - var name = this.read_namespace_name(); - var alias = this.read_use_alias(); - return result(name.name, alias, type); - }, - /** - * Reads a list of use declarations - * ```ebnf - * use_declarations ::= use_declaration (',' use_declaration)* - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L380 - * @return {UseItem[]} - */ - read_use_declarations: function read_use_declarations(typed) { - var result = [this.read_use_declaration(typed)]; - while (this.token === ",") { - result.push(this.next().read_use_declaration(typed)); - } - return result; - }, - /** - * Reads a use statement - * ```ebnf - * use_alias ::= (T_AS T_STRING)? - * ``` - * @return {String|null} - */ - read_use_alias: function read_use_alias() { - var result = null; - if (this.token === this.tok.T_AS) { - if (this.next().expect(this.tok.T_STRING)) { - result = this.text(); - this.next(); - } - } - return result; - }, - /** - * Reads the namespace type declaration - * ```ebnf - * use_type ::= (T_FUNCTION | T_CONST)? - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L335 - * @return {String|null} Possible values : function, const - */ - read_use_type: function read_use_type() { - if (this.token === this.tok.T_FUNCTION) { - this.next(); - return this.ast.useitem.TYPE_FUNCTION; - } else if (this.token === this.tok.T_CONST) { - this.next(); - return this.ast.useitem.TYPE_CONST; - } - return null; - } -}; - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * ```ebnf - * start ::= (namespace | top_statement)* - * ``` - */ - read_start: function read_start() { - if (this.token == this.tok.T_NAMESPACE) { - return this.read_namespace(); - } else { - return this.read_top_statement(); - } - } -}; - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * Reads a while statement - * ```ebnf - * while ::= T_WHILE (statement | ':' inner_statement_list T_ENDWHILE ';') - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L587 - * @return {While} - */ - read_while: function read_while() { - var result = this.node("while"); - var test = null; - var body = null; - var shortForm = false; - if (this.expect("(")) this.next(); - test = this.read_expr(); - if (this.expect(")")) this.next(); - if (this.token === ":") { - shortForm = true; - body = this.read_short_form(this.tok.T_ENDWHILE); - } else { - body = this.read_statement(); - } - return result(test, body, shortForm); - }, - /** - * Reads a do / while loop - * ```ebnf - * do ::= T_DO statement T_WHILE '(' expr ')' ';' - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L423 - * @return {Do} - */ - read_do: function read_do() { - var result = this.node("do"); - var test = null; - var body = null; - body = this.read_statement(); - if (this.expect(this.tok.T_WHILE)) { - if (this.next().expect("(")) this.next(); - test = this.read_expr(); - if (this.expect(")")) this.next(); - if (this.expect(";")) this.next(); - } - return result(test, body); - }, - /** - * Read a for incremental loop - * ```ebnf - * for ::= T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement - * for_statement ::= statement | ':' inner_statement_list T_ENDFOR ';' - * for_exprs ::= expr? (',' expr)* - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L425 - * @return {For} - */ - read_for: function read_for() { - var result = this.node("for"); - var init = []; - var test = []; - var increment = []; - var body = null; - var shortForm = false; - if (this.expect("(")) this.next(); - if (this.token !== ";") { - init = this.read_list(this.read_expr, ","); - if (this.expect(";")) this.next(); - } else { - this.next(); - } - if (this.token !== ";") { - test = this.read_list(this.read_expr, ","); - if (this.expect(";")) this.next(); - } else { - this.next(); - } - if (this.token !== ")") { - increment = this.read_list(this.read_expr, ","); - if (this.expect(")")) this.next(); - } else { - this.next(); - } - if (this.token === ":") { - shortForm = true; - body = this.read_short_form(this.tok.T_ENDFOR); - } else { - body = this.read_statement(); - } - return result(init, test, increment, body, shortForm); - }, - /** - * Reads a foreach loop - * ```ebnf - * foreach ::= '(' expr T_AS foreach_variable (T_DOUBLE_ARROW foreach_variable)? ')' statement - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L438 - * @return {Foreach} - */ - read_foreach: function read_foreach() { - var result = this.node("foreach"); - var source = null; - var key = null; - var value = null; - var body = null; - var shortForm = false; - if (this.expect("(")) this.next(); - source = this.read_expr(); - if (this.expect(this.tok.T_AS)) { - this.next(); - value = this.read_foreach_variable(); - if (this.token === this.tok.T_DOUBLE_ARROW) { - key = value; - value = this.next().read_foreach_variable(); - } - } - - // grammatically correct but not supported by PHP - if (key && key.kind === "list") { - this.raiseError("Fatal Error : Cannot use list as key element"); - } - - if (this.expect(")")) this.next(); - - if (this.token === ":") { - shortForm = true; - body = this.read_short_form(this.tok.T_ENDFOREACH); - } else { - body = this.read_statement(); - } - return result(source, key, value, body, shortForm); - }, - /** - * Reads a foreach variable statement - * ```ebnf - * foreach_variable = - * variable | - * '&' variable | - * T_LIST '(' assignment_list ')' | - * '[' assignment_list ']' - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L544 - * @return {Expression} - */ - read_foreach_variable: function read_foreach_variable() { - if (this.token === this.tok.T_LIST || this.token === "[") { - var isShort = this.token === "["; - var result = this.node("list"); - this.next(); - if (!isShort && this.expect("(")) this.next(); - var assignList = this.read_array_pair_list(isShort); - if (this.expect(isShort ? "]" : ")")) this.next(); - return result(assignList, isShort); - } else { - return this.read_variable(false, false, false); - } - } -}; - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * Reads an IF statement - * - * ```ebnf - * if ::= T_IF '(' expr ')' ':' ... - * ``` - */ - read_if: function read_if() { - var result = this.node("if"); - var body = null; - var alternate = null; - var shortForm = false; - var test = null; - test = this.next().read_if_expr(); - - if (this.token === ":") { - shortForm = true; - this.next(); - body = this.node("block"); - var items = []; - while (this.token !== this.EOF && this.token !== this.tok.T_ENDIF) { - if (this.token === this.tok.T_ELSEIF) { - alternate = this.read_elseif_short(); - break; - } else if (this.token === this.tok.T_ELSE) { - alternate = this.read_else_short(); - break; - } - items.push(this.read_inner_statement()); - } - body = body(null, items); - this.expect(this.tok.T_ENDIF) && this.next(); - this.expectEndOfStatement(); - } else { - body = this.read_statement(); - if (this.token === this.tok.T_ELSEIF) { - alternate = this.read_if(); - } else if (this.token === this.tok.T_ELSE) { - alternate = this.next().read_statement(); - } - } - return result(test, body, alternate, shortForm); - }, - /** - * reads an if expression : '(' expr ')' - */ - read_if_expr: function read_if_expr() { - this.expect("(") && this.next(); - var result = this.read_expr(); - this.expect(")") && this.next(); - return result; - }, - /** - * reads an elseif (expr): statements - */ - read_elseif_short: function read_elseif_short() { - var result = this.node("if"); - var alternate = null; - var test = null; - var body = null; - var items = []; - test = this.next().read_if_expr(); - if (this.expect(":")) this.next(); - body = this.node("block"); - while (this.token != this.EOF && this.token !== this.tok.T_ENDIF) { - if (this.token === this.tok.T_ELSEIF) { - alternate = this.read_elseif_short(); - break; - } else if (this.token === this.tok.T_ELSE) { - alternate = this.read_else_short(); - break; - } - items.push(this.read_inner_statement()); - } - body = body(null, items); - return result(test, body, alternate, true); - }, - /** - * - */ - read_else_short: function read_else_short() { - var body = this.node("block"); - if (this.next().expect(":")) this.next(); - var items = []; - while (this.token != this.EOF && this.token !== this.tok.T_ENDIF) { - items.push(this.read_inner_statement()); - } - return body(null, items); - } -}; - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * checks if current token is a reference keyword - */ - is_reference: function is_reference() { - if (this.token == "&") { - this.next(); - return true; - } - return false; - }, - /** - * checks if current token is a variadic keyword - */ - is_variadic: function is_variadic() { - if (this.token === this.tok.T_ELLIPSIS) { - this.next(); - return true; - } - return false; - }, - /** - * reading a function - * ```ebnf - * function ::= function_declaration code_block - * ``` - */ - read_function: function read_function(closure, flag) { - var result = this.read_function_declaration(closure ? 1 : flag ? 2 : 0, flag && flag[1] === 1); - if (flag && flag[2] == 1) { - // abstract function : - result.parseFlags(flag); - if (this.expect(";")) { - this.next(); - } - } else { - if (this.expect("{")) { - result.body = this.read_code_block(false); - if (result.loc && result.body.loc) { - result.loc.end = result.body.loc.end; - } - } - if (!closure && flag) { - result.parseFlags(flag); - } - } - return result; - }, - /** - * reads a function declaration (without his body) - * ```ebnf - * function_declaration ::= T_FUNCTION '&'? T_STRING '(' parameter_list ')' - * ``` - */ - read_function_declaration: function read_function_declaration(type, isStatic) { - var nodeName = "function"; - if (type === 1) { - nodeName = "closure"; - } else if (type === 2) { - nodeName = "method"; - } - var result = this.node(nodeName); - - if (this.expect(this.tok.T_FUNCTION)) { - this.next(); - } - var isRef = this.is_reference(); - var name = false, - use = [], - returnType = null, - nullable = false; - if (type !== 1) { - if (type === 2) { - if (this.token === this.tok.T_STRING || this.php7 && this.is("IDENTIFIER")) { - name = this.text(); - this.next(); - } else { - this.error("IDENTIFIER"); - } - } else { - if (this.expect(this.tok.T_STRING)) { - name = this.text(); - } - this.next(); - } - } - if (this.expect("(")) this.next(); - var params = this.read_parameter_list(); - if (this.expect(")")) this.next(); - if (type === 1 && this.token === this.tok.T_USE) { - if (this.next().expect("(")) this.next(); - use = this.read_list(this.read_lexical_var, ","); - if (this.expect(")")) this.next(); - } - if (this.token === ":") { - if (this.next().token === "?") { - nullable = true; - this.next(); - } - returnType = this.read_type(); - } - if (type === 1) { - // closure - return result(params, isRef, use, returnType, nullable, isStatic); - } - return result(name, params, isRef, returnType, nullable); - }, - /** - * ```ebnf - * lexical_var ::= '&'? T_VARIABLE - * ``` - */ - read_lexical_var: function read_lexical_var() { - var result = this.node("variable"); - var isRef = false; - if (this.token === "&") { - isRef = true; - this.next(); - } - this.expect(this.tok.T_VARIABLE); - var name = this.text().substring(1); - this.next(); - return result(name, isRef, false); - }, - /** - * reads a list of parameters - * ```ebnf - * parameter_list ::= (parameter ',')* parameter? - * ``` - */ - read_parameter_list: function read_parameter_list() { - var result = []; - if (this.token != ")") { - while (this.token != this.EOF) { - result.push(this.read_parameter()); - if (this.token == ",") { - this.next(); - } else if (this.token == ")") { - break; - } else { - this.error([",", ")"]); - break; - } - } - } - return result; - }, - /** - * ```ebnf - * parameter ::= type? '&'? T_ELLIPSIS? T_VARIABLE ('=' expr)? - * ``` - * @see https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L640 - */ - read_parameter: function read_parameter() { - var node = this.node("parameter"); - var name = null; - var value = null; - var type = null; - var nullable = false; - if (this.token === "?") { - this.next(); - nullable = true; - } - type = this.read_type(); - if (nullable && !type) { - this.raiseError("Expecting a type definition combined with nullable operator"); - } - var isRef = this.is_reference(); - var isVariadic = this.is_variadic(); - if (this.expect(this.tok.T_VARIABLE)) { - name = this.text().substring(1); - this.next(); - } - if (this.token == "=") { - value = this.next().read_expr(); - } - return node(name, type, value, isRef, isVariadic, nullable); - }, - /** - * Reads a list of arguments - * ```ebnf - * function_argument_list ::= '(' (argument_list (',' argument_list)*)? ')' - * ``` - */ - read_function_argument_list: function read_function_argument_list() { - var result = []; - var wasVariadic = false; - this.expect("(") && this.next(); - if (this.token !== ")") { - while (this.token != this.EOF) { - var argument = this.read_argument_list(); - if (argument) { - result.push(argument); - if (argument.kind === "variadic") { - wasVariadic = true; - } else if (wasVariadic) { - this.raiseError("Unexpected argument after a variadic argument"); - } - } - if (this.token === ",") { - this.next(); - } else break; - } - } - this.expect(")") && this.next(); - return result; - }, - /** - * ```ebnf - * argument_list ::= T_ELLIPSIS? expr - * ``` - */ - read_argument_list: function read_argument_list() { - if (this.token === this.tok.T_ELLIPSIS) { - return this.node("variadic")(this.next().read_expr()); - } - return this.read_expr(); - }, - /** - * read type hinting - * ```ebnf - * type ::= T_ARRAY | T_CALLABLE | namespace_name - * ``` - */ - read_type: function read_type() { - var result = this.node("identifier"); - switch (this.token) { - case this.tok.T_ARRAY: - this.next(); - return result(["", "array"], false); - case this.tok.T_NAMESPACE: - case this.tok.T_NS_SEPARATOR: - case this.tok.T_STRING: - return this.read_namespace_name(); - case this.tok.T_CALLABLE: - this.next(); - return result(["", "callable"], false); - default: - return null; - } - } -}; - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - read_expr: function read_expr() { - var result = this.node(); - var expr = this.read_expr_item(); - // binary operations - if (this.token === "|") return result("bin", "|", expr, this.next().read_expr()); - if (this.token === "&") return result("bin", "&", expr, this.next().read_expr()); - if (this.token === "^") return result("bin", "^", expr, this.next().read_expr()); - if (this.token === ".") return result("bin", ".", expr, this.next().read_expr()); - if (this.token === "+") return result("bin", "+", expr, this.next().read_expr()); - if (this.token === "-") return result("bin", "-", expr, this.next().read_expr()); - if (this.token === "*") return result("bin", "*", expr, this.next().read_expr()); - if (this.token === "/") return result("bin", "/", expr, this.next().read_expr()); - if (this.token === "%") return result("bin", "%", expr, this.next().read_expr()); - if (this.token === this.tok.T_POW) return result("bin", "**", expr, this.next().read_expr()); - if (this.token === this.tok.T_SL) return result("bin", "<<", expr, this.next().read_expr()); - if (this.token === this.tok.T_SR) return result("bin", ">>", expr, this.next().read_expr()); - // more binary operations (formerly bool) - if (this.token === this.tok.T_BOOLEAN_OR) return result("bin", "||", expr, this.next().read_expr()); - if (this.token === this.tok.T_LOGICAL_OR) return result("bin", "or", expr, this.next().read_expr()); - if (this.token === this.tok.T_BOOLEAN_AND) return result("bin", "&&", expr, this.next().read_expr()); - if (this.token === this.tok.T_LOGICAL_AND) return result("bin", "and", expr, this.next().read_expr()); - if (this.token === this.tok.T_LOGICAL_XOR) return result("bin", "xor", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_IDENTICAL) return result("bin", "===", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_NOT_IDENTICAL) return result("bin", "!==", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_EQUAL) return result("bin", "==", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_NOT_EQUAL) return result("bin", "!=", expr, this.next().read_expr()); - if (this.token === "<") return result("bin", "<", expr, this.next().read_expr()); - if (this.token === ">") return result("bin", ">", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_SMALLER_OR_EQUAL) return result("bin", "<=", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_GREATER_OR_EQUAL) return result("bin", ">=", expr, this.next().read_expr()); - if (this.token === this.tok.T_SPACESHIP) return result("bin", "<=>", expr, this.next().read_expr()); - if (this.token === this.tok.T_INSTANCEOF) return result("bin", "instanceof", expr, this.next().read_expr()); - - // extra operations : - // $username = $_GET['user'] ?? 'nobody'; - if (this.token === this.tok.T_COALESCE) return result("bin", "??", expr, this.next().read_expr()); - - // extra operations : - // $username = $_GET['user'] ? true : false; - if (this.token === "?") { - var trueArg = null; - if (this.next().token !== ":") { - trueArg = this.read_expr(); - } - this.expect(":") && this.next(); - return result("retif", expr, trueArg, this.read_expr()); - } - - return expr; - }, - - /** - * ```ebnf - * Reads an expression - * expr ::= @todo - * ``` - */ - read_expr_item: function read_expr_item() { - var result = void 0, - expr = void 0; - if (this.token === "@") return this.node("silent")(this.next().read_expr()); - if (this.token === "+") return this.node("unary")("+", this.next().read_expr()); - if (this.token === "!") return this.node("unary")("!", this.next().read_expr()); - if (this.token === "~") return this.node("unary")("~", this.next().read_expr()); - - if (this.token === "-") { - result = this.node(); - this.next(); - if (this.token === this.tok.T_LNUMBER || this.token === this.tok.T_DNUMBER) { - // negative number - result = result("number", "-" + this.text(), null); - this.next(); - return result; - } else { - return result("unary", "-", this.read_expr()); - } - } - - if (this.token === "(") { - expr = this.next().read_expr(); - expr.parenthesizedExpression = true; - this.expect(")") && this.next(); - return this.handleDereferencable(expr); - } - - if (this.token === "`") { - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1048 - return this.next().read_encapsed_string("`"); - } - - if (this.token === this.tok.T_LIST) { - var assign = null; - var isInner = this.innerList; - result = this.node("list"); - if (!isInner) { - assign = this.node("assign"); - } - if (this.next().expect("(")) { - this.next(); - } - - if (!this.innerList) this.innerList = true; - - // reads inner items - var assignList = this.read_array_pair_list(false); - if (this.expect(")")) { - this.next(); - } - - // check if contains at least one assignment statement - var hasItem = false; - for (var i = 0; i < assignList.length; i++) { - if (assignList[i] !== null) { - hasItem = true; - break; - } - } - if (!hasItem) { - this.raiseError("Fatal Error : Cannot use empty list on line " + this.lexer.yylloc.first_line); - } - - // handles the node resolution - if (!isInner) { - this.innerList = false; - if (this.expect("=")) { - return assign(result(assignList, false), this.next().read_expr(), "="); - } else { - // error fallback : list($a, $b); - return result(assignList, false); - } - } else { - return result(assignList, false); - } - } - - if (this.token === this.tok.T_CLONE) return this.node("clone")(this.next().read_expr()); - - switch (this.token) { - case this.tok.T_INC: - return this.node("pre")("+", this.next().read_variable(false, false, false)); - - case this.tok.T_DEC: - return this.node("pre")("-", this.next().read_variable(false, false, false)); - - case this.tok.T_NEW: - return this.next().read_new_expr(); - - case this.tok.T_ISSET: - { - result = this.node("isset"); - if (this.next().expect("(")) { - this.next(); - } - var args = this.read_list(this.read_expr, ","); - if (this.expect(")")) { - this.next(); - } - return result(args); - } - case this.tok.T_EMPTY: - { - result = this.node("empty"); - if (this.next().expect("(")) { - this.next(); - } - var arg = this.read_expr(); - if (this.expect(")")) { - this.next(); - } - return result([arg]); - } - case this.tok.T_INCLUDE: - return this.node("include")(false, false, this.next().read_expr()); - - case this.tok.T_INCLUDE_ONCE: - return this.node("include")(true, false, this.next().read_expr()); - - case this.tok.T_REQUIRE: - return this.node("include")(false, true, this.next().read_expr()); - - case this.tok.T_REQUIRE_ONCE: - return this.node("include")(true, true, this.next().read_expr()); - - case this.tok.T_EVAL: - result = this.node("eval"); - if (this.next().expect("(")) { - this.next(); - } - expr = this.read_expr(); - if (this.expect(")")) { - this.next(); - } - return result(expr); - - case this.tok.T_INT_CAST: - return this.node("cast")("int", this.text(), this.next().read_expr()); - - case this.tok.T_DOUBLE_CAST: - return this.node("cast")("float", this.text(), this.next().read_expr()); - - case this.tok.T_STRING_CAST: - return this.node("cast")(this.text().indexOf("binary") !== -1 ? "binary" : "string", this.text(), this.next().read_expr()); - - case this.tok.T_ARRAY_CAST: - return this.node("cast")("array", this.text(), this.next().read_expr()); - - case this.tok.T_OBJECT_CAST: - return this.node("cast")("object", this.text(), this.next().read_expr()); - - case this.tok.T_BOOL_CAST: - return this.node("cast")("bool", this.text(), this.next().read_expr()); - - case this.tok.T_UNSET_CAST: - return this.node("cast")("unset", this.text(), this.next().read_expr()); - - case this.tok.T_EXIT: - { - var useDie = this.lexer.yytext.toLowerCase() === "die"; - result = this.node("exit"); - var status = null; - if (this.next().token === "(") { - if (this.next().token !== ")") { - status = this.read_expr(); - if (this.expect(")")) { - this.next(); - } - } else { - this.next(); - } - } - return result(status, useDie); - } - - case this.tok.T_PRINT: - return this.node("print")(this.next().read_expr()); - - // T_YIELD (expr (T_DOUBLE_ARROW expr)?)? - case this.tok.T_YIELD: - { - var value = null; - var key = null; - result = this.node("yield"); - if (this.next().is("EXPR")) { - // reads the yield return value - value = this.read_expr(); - if (this.token === this.tok.T_DOUBLE_ARROW) { - // reads the yield returned key - key = value; - value = this.next().read_expr(); - } - } - return result(value, key); - } - - // T_YIELD_FROM expr - case this.tok.T_YIELD_FROM: - result = this.node("yieldfrom"); - expr = this.next().read_expr(); - return result(expr); - - case this.tok.T_FUNCTION: - return this.read_function(true); - - case this.tok.T_STATIC: - { - var backup = [this.token, this.lexer.getState()]; - if (this.next().token === this.tok.T_FUNCTION) { - // handles static function - return this.read_function(true, [0, 1, 0]); - } else { - // rollback - this.lexer.tokens.push(backup); - this.next(); - } - } - } - - // SCALAR | VARIABLE - if (this.is("VARIABLE")) { - result = this.node(); - expr = this.read_variable(false, false, false); - - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L877 - // should accept only a variable - var isConst = expr.kind === "constref" || expr.kind === "staticlookup" && expr.offset.kind === "constref"; - - // VARIABLES SPECIFIC OPERATIONS - switch (this.token) { - case "=": - { - if (isConst) this.error("VARIABLE"); - var right = void 0; - if (this.next().token == "&") { - if (this.next().token === this.tok.T_NEW) { - right = this.next().read_new_expr(); - } else { - right = this.read_variable(false, false, true); - } - } else { - right = this.read_expr(); - } - return result("assign", expr, right, "="); - } - - // operations : - case this.tok.T_PLUS_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "+="); - - case this.tok.T_MINUS_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "-="); - - case this.tok.T_MUL_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "*="); - - case this.tok.T_POW_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "**="); - - case this.tok.T_DIV_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "/="); - - case this.tok.T_CONCAT_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), ".="); - - case this.tok.T_MOD_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "%="); - - case this.tok.T_AND_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "&="); - - case this.tok.T_OR_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "|="); - - case this.tok.T_XOR_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "^="); - - case this.tok.T_SL_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "<<="); - - case this.tok.T_SR_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), ">>="); - - case this.tok.T_INC: - if (isConst) this.error("VARIABLE"); - this.next(); - return result("post", "+", expr); - case this.tok.T_DEC: - if (isConst) this.error("VARIABLE"); - this.next(); - return result("post", "-", expr); - } - } else if (this.is("SCALAR")) { - result = this.node(); - expr = this.read_scalar(); - if (expr.kind === "array" && expr.shortForm && this.token === "=") { - // list assign - var list = this.node("list")(expr.items, true); - if (expr.loc) list.loc = expr.loc; - var _right = this.next().read_expr(); - return result("assign", list, _right, "="); - } - // classic array - return this.handleDereferencable(expr); - } else { - this.error("EXPR"); - this.next(); - } - - // returns variable | scalar - return expr; - }, - /** - * ```ebnf - * new_expr ::= T_NEW (namespace_name function_argument_list) | (T_CLASS ... class declaration) - * ``` - * https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L850 - */ - read_new_expr: function read_new_expr() { - var result = this.node("new"); - var args = []; - if (this.token === this.tok.T_CLASS) { - var what = this.node("class"); - // Annonymous class declaration - var propExtends = null, - propImplements = null, - body = null; - if (this.next().token === "(") { - args = this.read_function_argument_list(); - } - if (this.token == this.tok.T_EXTENDS) { - propExtends = this.next().read_namespace_name(); - } - if (this.token == this.tok.T_IMPLEMENTS) { - propImplements = this.next().read_name_list(); - } - if (this.expect("{")) { - body = this.next().read_class_body(); - } - return result(what(null, propExtends, propImplements, body, [0, 0, 0]), args); - } - // Already existing class - var name = this.read_class_name_reference(); - if (this.token === "(") { - args = this.read_function_argument_list(); - } - return result(name, args); - }, - /** - * Reads a class name - * ```ebnf - * class_name_reference ::= namespace_name | variable - * ``` - */ - read_class_name_reference: function read_class_name_reference() { - if (this.token === this.tok.T_NS_SEPARATOR || this.token === this.tok.T_STRING || this.token === this.tok.T_NAMESPACE) { - var result = this.read_namespace_name(); - if (this.token === this.tok.T_DOUBLE_COLON) { - result = this.read_static_getter(result); - } - return result; - } else if (this.is("VARIABLE")) { - return this.read_variable(true, false, false); - } else { - this.expect([this.tok.T_STRING, "VARIABLE"]); - } - }, - handleDereferencable: function handleDereferencable(expr) { - while (this.token !== this.EOF) { - if (this.token === this.tok.T_OBJECT_OPERATOR) { - expr = this.recursive_variable_chain_scan(expr, false); - } else if (this.token === this.tok.T_CURLY_OPEN || this.token === "[") { - expr = this.read_dereferencable(expr); - } else if (this.token === "(") { - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1118 - expr = this.node("call")(expr, this.read_function_argument_list()); - } else { - return expr; - } - } - return expr; - } -}; - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * Comments with // or # or / * ... * / - */ - read_comment: function read_comment() { - var text = this.text(); - var result = this.ast.prepare(text.substring(0, 2) === "/*" ? "commentblock" : "commentline", null, this); - // handle location on comment - var prev = this.prev; - this.prev = [this.lexer.yylloc.last_line, this.lexer.yylloc.last_column, this.lexer.offset]; - this.lex(); - result = result(text); - this.prev = prev; - return result; - }, - /** - * Comments with / ** ... * / - */ - read_doc_comment: function read_doc_comment() { - var result = this.ast.prepare("commentblock", null, this); - var text = this.text(); - var prev = this.prev; - this.prev = [this.lexer.yylloc.last_line, this.lexer.yylloc.last_column, this.lexer.offset]; - this.lex(); - result = result(text); - this.prev = prev; - return result; - } -}; - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * reading a class - * ```ebnf - * class ::= class_scope? T_CLASS T_STRING (T_EXTENDS NAMESPACE_NAME)? (T_IMPLEMENTS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' CLASS_BODY '}' - * ``` - */ - read_class: function read_class(flag) { - var result = this.node("class"); - this.expect(this.tok.T_CLASS); - this.next().expect(this.tok.T_STRING); - var propName = this.text(); - var propExtends = null; - var propImplements = null; - if (this.next().token == this.tok.T_EXTENDS) { - propExtends = this.next().read_namespace_name(); - } - if (this.token == this.tok.T_IMPLEMENTS) { - propImplements = this.next().read_name_list(); - } - this.expect("{"); - var body = this.next().read_class_body(); - return result(propName, propExtends, propImplements, body, flag); - }, - /** - * Read the class visibility - * ```ebnf - * class_scope ::= (T_FINAL | T_ABSTRACT)? - * ``` - */ - read_class_scope: function read_class_scope() { - var result = this.token; - if (result == this.tok.T_FINAL) { - this.next(); - return [0, 0, 2]; - } else if (result == this.tok.T_ABSTRACT) { - this.next(); - return [0, 0, 1]; - } - return [0, 0, 0]; - }, - /** - * Reads a class body - * ```ebnf - * class_body ::= (member_flags? (T_VAR | T_STRING | T_FUNCTION))* - * ``` - */ - read_class_body: function read_class_body() { - var result = []; - - while (this.token !== this.EOF && this.token !== "}") { - if (this.token === this.tok.T_COMMENT) { - result.push(this.read_comment()); - continue; - } - - if (this.token === this.tok.T_DOC_COMMENT) { - result.push(this.read_doc_comment()); - continue; - } - - // check T_USE trait - if (this.token === this.tok.T_USE) { - result = result.concat(this.next().read_trait_use_statement()); - continue; - } - - // read member flags - var flags = this.read_member_flags(false); - - // check constant - if (this.token === this.tok.T_CONST) { - var constants = this.read_constant_list(flags); - if (this.expect(";")) { - this.next(); - } - result = result.concat(constants); - continue; - } - - // jump over T_VAR then land on T_VARIABLE - if (this.token === this.tok.T_VAR) { - this.next().expect(this.tok.T_VARIABLE); - flags[0] = flags[1] = 0; // public & non static var - } - - if (this.token === this.tok.T_VARIABLE) { - // reads a variable - var variables = this.read_variable_list(flags); - this.expect(";"); - this.next(); - result = result.concat(variables); - } else if (this.token === this.tok.T_FUNCTION) { - // reads a function - result.push(this.read_function(false, flags)); - } else { - // raise an error - this.error([this.tok.T_CONST, this.tok.T_VARIABLE, this.tok.T_FUNCTION]); - // ignore token - this.next(); - } - } - this.expect("}"); - this.next(); - return result; - }, - /** - * Reads variable list - * ```ebnf - * variable_list ::= (variable_declaration ',')* variable_declaration - * ``` - */ - read_variable_list: function read_variable_list(flags) { - return this.read_list( - /** - * Reads a variable declaration - * - * ```ebnf - * variable_declaration ::= T_VARIABLE '=' scalar - * ``` - */ - function read_variable_declaration() { - var result = this.node("property"); - this.expect(this.tok.T_VARIABLE); - var name = this.text().substring(1); // ignore $ - this.next(); - if (this.token === ";" || this.token === ",") { - return result(name, null, flags); - } else if (this.token === "=") { - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L815 - return result(name, this.next().read_expr(), flags); - } else { - this.expect([",", ";", "="]); - return result(name, null, flags); - } - }, ","); - }, - /** - * Reads constant list - * ```ebnf - * constant_list ::= T_CONST (constant_declaration ',')* constant_declaration - * ``` - */ - read_constant_list: function read_constant_list(flags) { - if (this.expect(this.tok.T_CONST)) { - this.next(); - } - return this.read_list( - /** - * Reads a constant declaration - * - * ```ebnf - * constant_declaration ::= (T_STRING | IDENTIFIER) '=' expr - * ``` - * @return {Constant} [:link:](AST.md#constant) - */ - function read_constant_declaration() { - var result = this.node("classconstant"); - var name = null; - var value = null; - if (this.token === this.tok.T_STRING || this.php7 && this.is("IDENTIFIER")) { - name = this.text(); - this.next(); - } else { - this.expect("IDENTIFIER"); - } - if (this.expect("=")) { - value = this.next().read_expr(); - } - return result(name, value, flags); - }, ","); - }, - /** - * Read member flags - * @return array - * 1st index : 0 => public, 1 => protected, 2 => private - * 2nd index : 0 => instance member, 1 => static member - * 3rd index : 0 => normal, 1 => abstract member, 2 => final member - */ - read_member_flags: function read_member_flags(asInterface) { - var result = [-1, -1, -1]; - if (this.is("T_MEMBER_FLAGS")) { - var idx = 0, - val = 0; - do { - switch (this.token) { - case this.tok.T_PUBLIC: - idx = 0; - val = 0; - break; - case this.tok.T_PROTECTED: - idx = 0; - val = 1; - break; - case this.tok.T_PRIVATE: - idx = 0; - val = 2; - break; - case this.tok.T_STATIC: - idx = 1; - val = 1; - break; - case this.tok.T_ABSTRACT: - idx = 2; - val = 1; - break; - case this.tok.T_FINAL: - idx = 2; - val = 2; - break; - } - if (asInterface) { - if (idx == 0 && val == 2) { - // an interface can't be private - this.expect([this.tok.T_PUBLIC, this.tok.T_PROTECTED]); - val = -1; - } else if (idx == 2 && val == 1) { - // an interface cant be abstract - this.error(); - val = -1; - } - } - if (result[idx] !== -1) { - // already defined flag - this.error(); - } else if (val !== -1) { - result[idx] = val; - } - } while (this.next().is("T_MEMBER_FLAGS")); - } - - if (result[1] == -1) result[1] = 0; - if (result[2] == -1) result[2] = 0; - return result; - }, - /** - * reading an interface - * ```ebnf - * interface ::= T_INTERFACE T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' INTERFACE_BODY '}' - * ``` - */ - read_interface: function read_interface() { - var result = this.node("interface"); - var name = null; - var body = null; - var propExtends = null; - if (this.expect(this.tok.T_INTERFACE)) { - this.next(); - } - if (this.expect(this.tok.T_STRING)) { - name = this.text(); - this.next(); - } - if (this.token === this.tok.T_EXTENDS) { - propExtends = this.next().read_name_list(); - } - if (this.expect("{")) { - body = this.next().read_interface_body(); - } - return result(name, propExtends, body); - }, - /** - * Reads an interface body - * ```ebnf - * interface_body ::= (member_flags? (T_CONST | T_FUNCTION))* - * ``` - */ - read_interface_body: function read_interface_body() { - var result = []; - - while (this.token !== this.EOF && this.token !== "}") { - if (this.token === this.tok.T_COMMENT) { - result.push(this.read_comment()); - continue; - } - - if (this.token === this.tok.T_DOC_COMMENT) { - result.push(this.read_doc_comment()); - continue; - } - - // read member flags - var flags = this.read_member_flags(true); - - // check constant - if (this.token == this.tok.T_CONST) { - var constants = this.read_constant_list(flags); - if (this.expect(";")) { - this.next(); - } - result = result.concat(constants); - } else if (this.token === this.tok.T_FUNCTION) { - // reads a function - var method = this.read_function_declaration(2, flags); - method.parseFlags(flags); - result.push(method); - if (this.expect(";")) { - this.next(); - } - } else { - // raise an error - this.error([this.tok.T_CONST, this.tok.T_FUNCTION]); - this.next(); - } - } - if (this.expect("}")) { - this.next(); - } - return result; - }, - /** - * reading a trait - * ```ebnf - * trait ::= T_TRAIT T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' FUNCTION* '}' - * ``` - */ - read_trait: function read_trait() { - var result = this.node("trait"); - var propName = null; - var propExtends = null; - var propImplements = null; - var body = null; - if (this.expect(this.tok.T_TRAIT)) { - this.next(); - } - if (this.expect(this.tok.T_STRING)) { - propName = this.text(); - } - if (this.next().token == this.tok.T_EXTENDS) { - propExtends = this.next().read_namespace_name(); - } - if (this.token == this.tok.T_IMPLEMENTS) { - propImplements = this.next().read_name_list(); - } - if (this.expect("{")) { - body = this.next().read_class_body(); - } - return result(propName, propExtends, propImplements, body); - }, - /** - * reading a use statement - * ```ebnf - * trait_use_statement ::= namespace_name (',' namespace_name)* ('{' trait_use_alias '}')? - * ``` - */ - read_trait_use_statement: function read_trait_use_statement() { - // defines use statements - var node = this.node("traituse"); - var traits = [this.read_namespace_name()]; - var adaptations = null; - while (this.token === ",") { - traits.push(this.next().read_namespace_name()); - } - if (this.token === "{") { - adaptations = []; - // defines alias statements - while (this.next().token !== this.EOF) { - if (this.token === "}") break; - adaptations.push(this.read_trait_use_alias()); - this.expect(";"); - } - if (this.expect("}")) { - this.next(); - } - } else { - if (this.expect(";")) { - this.next(); - } - } - return node(traits, adaptations); - }, - /** - * Reading trait alias - * ```ebnf - * trait_use_alias ::= namespace_name ( T_DOUBLE_COLON T_STRING )? (T_INSTEADOF namespace_name) | (T_AS member_flags? T_STRING) - * ``` - * name list : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L303 - * trait adaptation : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L742 - */ - read_trait_use_alias: function read_trait_use_alias() { - var node = this.node(); - var trait = null; - var method = void 0; - - if (this.is("IDENTIFIER")) { - method = this.text(); - this.next(); - } else { - method = this.read_namespace_name(); - - if (this.token === this.tok.T_DOUBLE_COLON) { - this.next(); - if (this.token === this.tok.T_STRING || this.php7 && this.is("IDENTIFIER")) { - trait = method; - method = this.text(); - this.next(); - } else { - this.expect(this.tok.T_STRING); - } - } else { - // convert identifier as string - method = method.name; - } - } - - // handle trait precedence - if (this.token === this.tok.T_INSTEADOF) { - return node("traitprecedence", trait, method, this.next().read_name_list()); - } else if (this.token === this.tok.T_AS) { - // handle trait alias - var flags = null; - var alias = null; - if (this.next().is("T_MEMBER_FLAGS")) { - flags = this.read_member_flags(); - } - - if (this.token === this.tok.T_STRING || this.php7 && this.is("IDENTIFIER")) { - alias = this.text(); - this.next(); - } else if (flags === false) { - // no visibility flags and no name => too bad - this.expect(this.tok.T_STRING); - } - - return node("traitalias", trait, method, alias, flags); - } - - // handle errors - this.expect([this.tok.T_AS, this.tok.T_INSTEADOF]); - return node("traitalias", trait, method, null, null); - } -}; - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var ArrayExpr = "array"; -var ArrayEntry = "entry"; - -module.exports = { - /** - * Parse an array - * ```ebnf - * array ::= T_ARRAY '(' array_pair_list ')' | - * '[' array_pair_list ']' - * ``` - */ - read_array: function read_array() { - var expect = null; - var shortForm = false; - var result = this.node(ArrayExpr); - - if (this.token === this.tok.T_ARRAY) { - this.next().expect("("); - expect = ")"; - } else { - shortForm = true; - expect = "]"; - } - var items = []; - if (this.next().token !== expect) { - items = this.read_array_pair_list(shortForm); - } - // check non empty entries - /*for(let i = 0, size = items.length - 1; i < size; i++) { - if (items[i] === null) { - this.raiseError( - "Cannot use empty array elements in arrays" - ); - } - }*/ - this.expect(expect); - this.next(); - return result(shortForm, items); - }, - /** - * Reads an array of items - * ```ebnf - * array_pair_list ::= array_pair (',' array_pair?)* - * ``` - */ - read_array_pair_list: function read_array_pair_list(shortForm) { - var self = this; - return this.read_list(function () { - return self.read_array_pair(shortForm); - }, ",", true); - }, - /** - * Reads an entry - * array_pair: - * expr T_DOUBLE_ARROW expr - * | expr - * | expr T_DOUBLE_ARROW '&' variable - * | '&' variable - * | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' - * | T_LIST '(' array_pair_list ')' - */ - read_array_pair: function read_array_pair(shortForm) { - if (this.token === "," || !shortForm && this.token === ")" || shortForm && this.token === "]") { - return null; - } - if (this.token === "&") { - return this.next().read_variable(true, false, true); - } else { - var entry = this.node(ArrayEntry); - var expr = this.read_expr(); - if (this.token === this.tok.T_DOUBLE_ARROW) { - if (this.next().token === "&") { - return entry(expr, this.next().read_variable(true, false, true)); - } else { - return entry(expr, this.read_expr()); - } - } - return expr; - } - }, - /** - * ```ebnf - * dim_offset ::= expr? - * ``` - */ - read_dim_offset: function read_dim_offset() { - if (this.token == "]") return false; - return this.read_expr(); - } -}; - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -/** - * @private - */ - -function isNumber(n) { - return n != "." && n != "," && !isNaN(parseFloat(n)) && isFinite(n); -} - -/** - * The PHP Parser class that build the AST tree from the lexer - * - * @class - * @tutorial Parser - * @property {Lexer} lexer - current lexer instance - * @property {AST} ast - the AST factory instance - * @property {Integer|String} token - current token - * @property {Boolean} extractDoc - should extract documentation as AST node - * @property {Boolean} extractTokens - should extract each token - * @property {Boolean} suppressErrors - should ignore parsing errors and continue - * @property {Boolean} debug - should output debug informations - */ -var parser = function parser(lexer, ast) { - this.lexer = lexer; - this.ast = ast; - this.tok = lexer.tok; - this.EOF = lexer.EOF; - this.token = null; - this.prev = null; - this.debug = false; - this.php7 = true; - this.extractDoc = false; - this.extractTokens = false; - this.suppressErrors = false; - var mapIt = function mapIt(item) { - return [item, null]; - }; - this.entries = { - IDENTIFIER: new Map([this.tok.T_ABSTRACT, this.tok.T_ARRAY, this.tok.T_AS, this.tok.T_BREAK, this.tok.T_CALLABLE, this.tok.T_CASE, this.tok.T_CATCH, this.tok.T_CLASS, this.tok.T_CLASS_C, this.tok.T_CLONE, this.tok.T_CONST, this.tok.T_CONTINUE, this.tok.T_DECLARE, this.tok.T_DEFAULT, this.tok.T_DIR, this.tok.T_DO, this.tok.T_ECHO, this.tok.T_ELSE, this.tok.T_ELSEIF, this.tok.T_EMPTY, this.tok.T_ENDDECLARE, this.tok.T_ENDFOR, this.tok.T_ENDFOREACH, this.tok.T_ENDIF, this.tok.T_ENDSWITCH, this.tok.T_ENDWHILE, this.tok.T_EVAL, this.tok.T_EXIT, this.tok.T_EXTENDS, this.tok.T_FILE, this.tok.T_FINAL, this.tok.T_FINALLY, this.tok.T_FUNC_C, this.tok.T_FOR, this.tok.T_FOREACH, this.tok.T_FUNCTION, this.tok.T_GLOBAL, this.tok.T_GOTO, this.tok.T_IF, this.tok.T_IMPLEMENTS, this.tok.T_INCLUDE, this.tok.T_INCLUDE_ONCE, this.tok.T_INSTANCEOF, this.tok.T_INSTEADOF, this.tok.T_INTERFACE, this.tok.T_ISSET, this.tok.T_LINE, this.tok.T_LIST, this.tok.T_LOGICAL_AND, this.tok.T_LOGICAL_OR, this.tok.T_LOGICAL_XOR, this.tok.T_METHOD_C, this.tok.T_NAMESPACE, this.tok.T_NEW, this.tok.T_NS_C, this.tok.T_PRINT, this.tok.T_PRIVATE, this.tok.T_PROTECTED, this.tok.T_PUBLIC, this.tok.T_REQUIRE, this.tok.T_REQUIRE_ONCE, this.tok.T_RETURN, this.tok.T_STATIC, this.tok.T_SWITCH, this.tok.T_THROW, this.tok.T_TRAIT, this.tok.T_TRY, this.tok.T_UNSET, this.tok.T_USE, this.tok.T_VAR, this.tok.T_WHILE, this.tok.T_YIELD].map(mapIt)), - VARIABLE: new Map([this.tok.T_VARIABLE, "$", "&", this.tok.T_NS_SEPARATOR, this.tok.T_STRING, this.tok.T_NAMESPACE, this.tok.T_STATIC].map(mapIt)), - SCALAR: new Map([this.tok.T_CONSTANT_ENCAPSED_STRING, this.tok.T_START_HEREDOC, this.tok.T_LNUMBER, this.tok.T_DNUMBER, this.tok.T_ARRAY, "[", this.tok.T_CLASS_C, this.tok.T_TRAIT_C, this.tok.T_FUNC_C, this.tok.T_METHOD_C, this.tok.T_LINE, this.tok.T_FILE, this.tok.T_DIR, this.tok.T_NS_C, '"', 'b"', 'B"', "-", this.tok.T_NS_SEPARATOR].map(mapIt)), - T_MAGIC_CONST: new Map([this.tok.T_CLASS_C, this.tok.T_TRAIT_C, this.tok.T_FUNC_C, this.tok.T_METHOD_C, this.tok.T_LINE, this.tok.T_FILE, this.tok.T_DIR, this.tok.T_NS_C].map(mapIt)), - T_MEMBER_FLAGS: new Map([this.tok.T_PUBLIC, this.tok.T_PRIVATE, this.tok.T_PROTECTED, this.tok.T_STATIC, this.tok.T_ABSTRACT, this.tok.T_FINAL].map(mapIt)), - EOS: new Map([";", this.EOF, this.tok.T_INLINE_HTML].map(mapIt)), - EXPR: new Map(["@", "-", "+", "!", "~", "(", "`", this.tok.T_LIST, this.tok.T_CLONE, this.tok.T_INC, this.tok.T_DEC, this.tok.T_NEW, this.tok.T_ISSET, this.tok.T_EMPTY, this.tok.T_INCLUDE, this.tok.T_INCLUDE_ONCE, this.tok.T_REQUIRE, this.tok.T_REQUIRE_ONCE, this.tok.T_EVAL, this.tok.T_INT_CAST, this.tok.T_DOUBLE_CAST, this.tok.T_STRING_CAST, this.tok.T_ARRAY_CAST, this.tok.T_OBJECT_CAST, this.tok.T_BOOL_CAST, this.tok.T_UNSET_CAST, this.tok.T_EXIT, this.tok.T_PRINT, this.tok.T_YIELD, this.tok.T_STATIC, this.tok.T_FUNCTION, - // using VARIABLES : - this.tok.T_VARIABLE, "$", this.tok.T_NS_SEPARATOR, this.tok.T_STRING, - // using SCALAR : - this.tok.T_STRING, // @see variable.js line 45 > conflict with variable = shift/reduce :) - this.tok.T_CONSTANT_ENCAPSED_STRING, this.tok.T_START_HEREDOC, this.tok.T_LNUMBER, this.tok.T_DNUMBER, this.tok.T_ARRAY, "[", this.tok.T_CLASS_C, this.tok.T_TRAIT_C, this.tok.T_FUNC_C, this.tok.T_METHOD_C, this.tok.T_LINE, this.tok.T_FILE, this.tok.T_DIR, this.tok.T_NS_C].map(mapIt)) - }; -}; - -/** - * helper : gets a token name - */ -parser.prototype.getTokenName = function (token) { - if (!isNumber(token)) { - return "'" + token + "'"; - } else { - if (token == this.EOF) return "the end of file (EOF)"; - return this.lexer.engine.tokens.values[token]; - } -}; - -/** - * main entry point : converts a source code to AST - */ -parser.prototype.parse = function (code, filename) { - this._errors = []; - this.filename = filename || "eval"; - this.currentNamespace = [""]; - if (this.extractDoc) { - this._docs = []; - } else { - this._docs = null; - } - if (this.extractTokens) { - this._tokens = []; - } else { - this._tokens = null; - } - this._docIndex = 0; - this.lexer.setInput(code); - this.lexer.all_tokens = this.extractTokens; - this.lexer.comment_tokens = this.extractDoc; - this.length = this.lexer._input.length; - this.innerList = false; - this.innerListForm = false; - var program = this.ast.prepare("program", null, this); - var childs = []; - this.next(); - while (this.token != this.EOF) { - var node = this.read_start(); - if (node !== null && node !== undefined) { - if (Array.isArray(node)) { - childs = childs.concat(node); - } else { - childs.push(node); - } - } - } - return program(childs, this._errors, this._docs, this._tokens); -}; - -/** - * Raise an error - */ -parser.prototype.raiseError = function (message, msgExpect, expect, token) { - message += " on line " + this.lexer.yylloc.first_line; - if (!this.suppressErrors) { - var err = new SyntaxError(message, this.filename, this.lexer.yylloc.first_line); - err.lineNumber = this.lexer.yylloc.first_line; - err.fileName = this.filename; - err.columnNumber = this.lexer.yylloc.first_column; - throw err; - } - // Error node : - var node = this.ast.prepare("error", null, this)(message, token, this.lexer.yylloc.first_line, expect); - this._errors.push(node); - return node; -}; - -/** - * handling errors - */ -parser.prototype.error = function (expect) { - var msg = "Parse Error : syntax error"; - var token = this.getTokenName(this.token); - var msgExpect = ""; - - if (this.token !== this.EOF) { - if (isNumber(this.token)) { - var symbol = this.text(); - if (symbol.length > 10) { - symbol = symbol.substring(0, 7) + "..."; - } - token = "'" + symbol + "' (" + token + ")"; - } - msg += ", unexpected " + token; - } - if (expect && !Array.isArray(expect)) { - if (isNumber(expect) || expect.length === 1) { - msgExpect = ", expecting " + this.getTokenName(expect); - } - msg += msgExpect; - } - return this.raiseError(msg, msgExpect, expect, token); -}; - -/** - * Creates a new AST node - */ -parser.prototype.node = function (name) { - if (this.extractDoc) { - if (this._docIndex < this._docs.length) { - var docs = this._docs.slice(this._docIndex); - this._docIndex = this._docs.length; - return this.ast.prepare(name, docs, this); - } - } - return this.ast.prepare(name, null, this); -}; - -/** - * expects an end of statement or end of file - * @return {boolean} - */ -parser.prototype.expectEndOfStatement = function (node) { - if (this.token === ";") { - // include only real ';' statements - // https://github.com/glayzzle/php-parser/issues/164 - if (node && this.lexer.yytext === ";") { - node.includeToken(this); - } - } else if (this.token !== this.tok.T_INLINE_HTML && this.token !== this.EOF) { - this.error(";"); - return false; - } - this.next(); - return true; -}; - -/** outputs some debug information on current token **/ -var ignoreStack = ["parser.next"]; -parser.prototype.showlog = function () { - var stack = new Error().stack.split("\n"); - var line = void 0; - for (var offset = 2; offset < stack.length; offset++) { - line = stack[offset].trim(); - var found = false; - for (var i = 0; i < ignoreStack.length; i++) { - if (line.substring(3, 3 + ignoreStack[i].length) === ignoreStack[i]) { - found = true; - break; - } - } - if (!found) { - break; - } - } - // eslint-disable-next-line no-console - console.log("Line " + this.lexer.yylloc.first_line + " : " + this.getTokenName(this.token) + ">" + this.lexer.yytext + "<" + " @-->" + line); - return this; -}; - -/** - * Force the parser to check the current token. - * - * If the current token does not match to expected token, - * the an error will be raised. - * - * If the suppressError mode is activated, then the error will - * be added to the program error stack and this function will return `false`. - * - * @param {String|Number} token - * @return {boolean} - * @throws Error - */ -parser.prototype.expect = function (token) { - if (Array.isArray(token)) { - if (token.indexOf(this.token) === -1) { - this.error(token); - return false; - } - } else if (this.token != token) { - this.error(token); - return false; - } - return true; -}; - -/** - * Returns the current token contents - * @return {String} - */ -parser.prototype.text = function () { - return this.lexer.yytext; -}; - -/** consume the next token **/ -parser.prototype.next = function () { - // prepare the back command - if (this.token !== ";" || this.lexer.yytext === ";") { - // ignore '?>' from automated resolution - // https://github.com/glayzzle/php-parser/issues/168 - this.prev = [this.lexer.yylloc.last_line, this.lexer.yylloc.last_column, this.lexer.offset]; - } - - // eating the token - this.lex(); - - // showing the debug - if (this.debug) { - this.showlog(); - } - - // handling comments - if (this.extractDoc) { - while (this.token === this.tok.T_COMMENT || this.token === this.tok.T_DOC_COMMENT) { - // APPEND COMMENTS - if (this.token === this.tok.T_COMMENT) { - this._docs.push(this.read_comment()); - } else { - this._docs.push(this.read_doc_comment()); - } - } - } - - return this; -}; - -/** - * Eating a token - */ -parser.prototype.lex = function () { - // append on token stack - if (this.extractTokens) { - do { - // the token - this.token = this.lexer.lex() || this.EOF; - if (this.token === this.EOF) return this; - var entry = this.lexer.yytext; - if (this.lexer.engine.tokens.values.hasOwnProperty(this.token)) { - entry = [this.lexer.engine.tokens.values[this.token], entry, this.lexer.yylloc.first_line, this.lexer.yylloc.first_offset, this.lexer.offset]; - } else { - entry = [null, entry, this.lexer.yylloc.first_line, this.lexer.yylloc.first_offset, this.lexer.offset]; - } - this._tokens.push(entry); - if (this.token === this.tok.T_CLOSE_TAG) { - // https://github.com/php/php-src/blob/7ff186434e82ee7be7c59d0db9a976641cf7b09c/Zend/zend_compile.c#L1680 - this.token = ";"; - return this; - } else if (this.token === this.tok.T_OPEN_TAG_WITH_ECHO) { - this.token = this.tok.T_ECHO; - return this; - } - } while (this.token === this.tok.T_WHITESPACE || // ignore white space - !this.extractDoc && (this.token === this.tok.T_COMMENT || // ignore single lines comments - this.token === this.tok.T_DOC_COMMENT) || // ignore doc comments - // ignore open tags - this.token === this.tok.T_OPEN_TAG); - } else { - this.token = this.lexer.lex() || this.EOF; - } - return this; -}; - -/** - * Check if token is of specified type - */ -parser.prototype.is = function (type) { - if (Array.isArray(type)) { - return type.indexOf(this.token) !== -1; - } - return this.entries[type].has(this.token); -}; - -// extends the parser with syntax files -[__webpack_require__(105), __webpack_require__(104), __webpack_require__(103), __webpack_require__(102), __webpack_require__(101), __webpack_require__(100), __webpack_require__(99), __webpack_require__(98), __webpack_require__(97), __webpack_require__(96), __webpack_require__(95), __webpack_require__(94), __webpack_require__(93), __webpack_require__(92), __webpack_require__(91)].forEach(function (ext) { - for (var k in ext) { - parser.prototype[k] = ext[k]; - } -}); - -module.exports = parser; - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var tokens = ";:,.\\[]()|^&+-/*=%!~$<>?@"; - -module.exports = { - // check if the char can be a numeric - is_NUM: function is_NUM() { - var ch = this._input.charCodeAt(this.offset - 1); - return ch > 47 && ch < 58; - }, - - // check if current char can be a label - is_LABEL: function is_LABEL() { - var ch = this._input.charCodeAt(this.offset - 1); - return ch > 96 && ch < 123 || ch > 64 && ch < 91 || ch === 95 || ch > 47 && ch < 58 || ch > 126; - }, - - // check if current char can be a label - is_LABEL_START: function is_LABEL_START() { - var ch = this._input.charCodeAt(this.offset - 1); - return ch > 96 && ch < 123 || ch > 64 && ch < 91 || ch === 95 || ch > 126; - }, - - // reads each char of the label - consume_LABEL: function consume_LABEL() { - while (this.offset < this.size) { - var ch = this.input(); - if (!this.is_LABEL()) { - if (ch) this.unput(1); - break; - } - } - return this; - }, - - // check if current char is a token char - is_TOKEN: function is_TOKEN() { - var ch = this._input[this.offset - 1]; - return tokens.indexOf(ch) !== -1; - }, - // check if current char is a whitespace - is_WHITESPACE: function is_WHITESPACE() { - var ch = this._input[this.offset - 1]; - return ch === " " || ch === "\t" || ch === "\n" || ch === "\r"; - }, - // check if current char is a whitespace (without newlines) - is_TABSPACE: function is_TABSPACE() { - var ch = this._input[this.offset - 1]; - return ch === " " || ch === "\t"; - }, - // consume all whitespaces (excluding newlines) - consume_TABSPACE: function consume_TABSPACE() { - while (this.offset < this.size) { - var ch = this.input(); - if (!this.is_TABSPACE()) { - if (ch) this.unput(1); - break; - } - } - return this; - }, - // check if current char can be a hexadecimal number - is_HEX: function is_HEX() { - var ch = this._input.charCodeAt(this.offset - 1); - return ch > 47 && ch < 58 || ch > 64 && ch < 71 || ch > 96 && ch < 103; - } -}; - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - T_STRING: function T_STRING() { - var token = this.yytext.toLowerCase(); - var id = this.keywords[token]; - if (typeof id !== "number") { - if (token === "yield") { - if (this.php7 && this.tryMatch(" from")) { - this.consume(5); - id = this.tok.T_YIELD_FROM; - } else { - id = this.tok.T_YIELD; - } - } else { - id = this.tok.T_STRING; - if (token === "b" || token === "B") { - var ch = this.input(1); - if (ch === '"') { - return this.ST_DOUBLE_QUOTES(); - } else if (ch === "'") { - return this.T_CONSTANT_ENCAPSED_STRING(); - } else if (ch) { - this.unput(1); - } - } - } - } - return id; - }, - // reads a custom token - consume_TOKEN: function consume_TOKEN() { - var ch = this._input[this.offset - 1]; - var fn = this.tokenTerminals[ch]; - if (fn) { - return fn.apply(this, []); - } else { - return this.yytext; - } - }, - // list of special char tokens - tokenTerminals: { - $: function $() { - this.offset++; - if (this.is_LABEL_START()) { - this.offset--; - this.consume_LABEL(); - return this.tok.T_VARIABLE; - } else { - this.offset--; - return "$"; - } - }, - "-": function _() { - var nchar = this._input[this.offset]; - if (nchar === ">") { - this.begin("ST_LOOKING_FOR_PROPERTY").input(); - return this.tok.T_OBJECT_OPERATOR; - } else if (nchar === "-") { - this.input(); - return this.tok.T_DEC; - } else if (nchar === "=") { - this.input(); - return this.tok.T_MINUS_EQUAL; - } - return "-"; - }, - "\\": function _() { - return this.tok.T_NS_SEPARATOR; - }, - "/": function _() { - if (this._input[this.offset] === "=") { - this.input(); - return this.tok.T_DIV_EQUAL; - } - return "/"; - }, - ":": function _() { - if (this._input[this.offset] === ":") { - this.input(); - return this.tok.T_DOUBLE_COLON; - } else { - return ":"; - } - }, - "(": function _() { - var initial = this.offset; - this.input(); - if (this.is_TABSPACE()) { - this.consume_TABSPACE().input(); - } - if (this.is_LABEL_START()) { - var yylen = this.yytext.length; - this.consume_LABEL(); - var castToken = this.yytext.substring(yylen - 1).toLowerCase(); - var castId = this.castKeywords[castToken]; - if (typeof castId === "number") { - this.input(); - if (this.is_TABSPACE()) { - this.consume_TABSPACE().input(); - } - if (this._input[this.offset - 1] === ")") { - return castId; - } - } - } - // revert the check - this.unput(this.offset - initial); - return "("; - }, - "=": function _() { - var nchar = this._input[this.offset]; - if (nchar === ">") { - this.input(); - return this.tok.T_DOUBLE_ARROW; - } else if (nchar === "=") { - if (this._input[this.offset + 1] === "=") { - this.consume(2); - return this.tok.T_IS_IDENTICAL; - } else { - this.input(); - return this.tok.T_IS_EQUAL; - } - } - return "="; - }, - "+": function _() { - var nchar = this._input[this.offset]; - if (nchar === "+") { - this.input(); - return this.tok.T_INC; - } else if (nchar === "=") { - this.input(); - return this.tok.T_PLUS_EQUAL; - } - return "+"; - }, - "!": function _() { - if (this._input[this.offset] === "=") { - if (this._input[this.offset + 1] === "=") { - this.consume(2); - return this.tok.T_IS_NOT_IDENTICAL; - } else { - this.input(); - return this.tok.T_IS_NOT_EQUAL; - } - } - return "!"; - }, - "?": function _() { - if (this.php7 && this._input[this.offset] === "?") { - this.input(); - return this.tok.T_COALESCE; - } - return "?"; - }, - "<": function _() { - var nchar = this._input[this.offset]; - if (nchar === "<") { - nchar = this._input[this.offset + 1]; - if (nchar === "=") { - this.consume(2); - return this.tok.T_SL_EQUAL; - } else if (nchar === "<") { - if (this.is_HEREDOC()) { - return this.tok.T_START_HEREDOC; - } - } - this.input(); - return this.tok.T_SL; - } else if (nchar === "=") { - this.input(); - if (this.php7 && this._input[this.offset] === ">") { - this.input(); - return this.tok.T_SPACESHIP; - } else { - return this.tok.T_IS_SMALLER_OR_EQUAL; - } - } else if (nchar === ">") { - this.input(); - return this.tok.T_IS_NOT_EQUAL; - } - return "<"; - }, - ">": function _() { - var nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_IS_GREATER_OR_EQUAL; - } else if (nchar === ">") { - nchar = this._input[this.offset + 1]; - if (nchar === "=") { - this.consume(2); - return this.tok.T_SR_EQUAL; - } else { - this.input(); - return this.tok.T_SR; - } - } - return ">"; - }, - "*": function _() { - var nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_MUL_EQUAL; - } else if (nchar === "*") { - this.input(); - if (this._input[this.offset] === "=") { - this.input(); - return this.tok.T_POW_EQUAL; - } else { - return this.tok.T_POW; - } - } - return "*"; - }, - ".": function _() { - var nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_CONCAT_EQUAL; - } else if (nchar === "." && this._input[this.offset + 1] === ".") { - this.consume(2); - return this.tok.T_ELLIPSIS; - } - return "."; - }, - "%": function _() { - if (this._input[this.offset] === "=") { - this.input(); - return this.tok.T_MOD_EQUAL; - } - return "%"; - }, - "&": function _() { - var nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_AND_EQUAL; - } else if (nchar === "&") { - this.input(); - return this.tok.T_BOOLEAN_AND; - } - return "&"; - }, - "|": function _() { - var nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_OR_EQUAL; - } else if (nchar === "|") { - this.input(); - return this.tok.T_BOOLEAN_OR; - } - return "|"; - }, - "^": function _() { - if (this._input[this.offset] === "=") { - this.input(); - return this.tok.T_XOR_EQUAL; - } - return "^"; - } - } -}; - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - T_CONSTANT_ENCAPSED_STRING: function T_CONSTANT_ENCAPSED_STRING() { - var ch = void 0; - while (this.offset < this.size) { - ch = this.input(); - if (ch == "\\") { - this.input(); - } else if (ch == "'") { - break; - } - } - return this.tok.T_CONSTANT_ENCAPSED_STRING; - }, - // check if matching a HEREDOC state - is_HEREDOC: function is_HEREDOC() { - var revert = this.offset; - if (this._input[this.offset - 1] === "<" && this._input[this.offset] === "<" && this._input[this.offset + 1] === "<") { - this.offset += 3; - - // optional tabs / spaces - if (this.is_TABSPACE()) { - while (this.offset < this.size) { - this.offset++; - if (!this.is_TABSPACE()) { - break; - } - } - } - - // optional quotes - var tChar = this._input[this.offset - 1]; - if (tChar === "'" || tChar === '"') { - this.offset++; - } else { - tChar = null; - } - - // required label - if (this.is_LABEL_START()) { - var yyoffset = this.offset - 1; - while (this.offset < this.size) { - this.offset++; - if (!this.is_LABEL()) { - break; - } - } - var yylabel = this._input.substring(yyoffset, this.offset - 1); - if (!tChar || tChar === this._input[this.offset - 1]) { - // required ending quote - if (tChar) this.offset++; - // require newline - if (this._input[this.offset - 1] === "\r" || this._input[this.offset - 1] === "\n") { - // go go go - this.heredoc_label = yylabel; - yyoffset = this.offset - revert; - this.offset = revert; - this.consume(yyoffset); - if (tChar === "'") { - this.begin("ST_NOWDOC"); - } else { - this.begin("ST_HEREDOC"); - } - return this.tok.T_START_HEREDOC; - } - } - } - } - this.offset = revert; - return false; - }, - ST_DOUBLE_QUOTES: function ST_DOUBLE_QUOTES() { - var ch = void 0; - while (this.offset < this.size) { - ch = this.input(); - if (ch == "\\") { - this.input(); - } else if (ch == '"') { - break; - } else if (ch == "$") { - ch = this.input(); - if (ch == "{" || this.is_LABEL_START()) { - this.unput(2); - break; - } - if (ch) this.unput(1); - } else if (ch == "{") { - ch = this.input(); - if (ch == "$") { - this.unput(2); - break; - } - if (ch) this.unput(1); - } - } - if (ch == '"') { - return this.tok.T_CONSTANT_ENCAPSED_STRING; - } else { - var prefix = 1; - if (this.yytext[0] === "b" || this.yytext[0] === "B") { - prefix = 2; - } - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE, this.yytext.length - prefix); - } - this.unput(this.yytext.length - prefix); - this.begin("ST_DOUBLE_QUOTES"); - return this.yytext; - } - }, - - // check if its a DOC end sequence - isDOC_MATCH: function isDOC_MATCH() { - // @fixme : check if out of text limits - if (this._input.substring(this.offset - 1, this.offset - 1 + this.heredoc_label.length) === this.heredoc_label) { - var ch = this._input[this.offset - 1 + this.heredoc_label.length]; - if (ch === "\n" || ch === "\r" || ch === ";") { - return true; - } - } - return false; - }, - - matchST_NOWDOC: function matchST_NOWDOC() { - /** edge case : empty now doc **/ - if (this.isDOC_MATCH()) { - // @fixme : never reached (may be caused by quotes) - this.consume(this.heredoc_label.length); - this.popState(); - return this.tok.T_END_HEREDOC; - } - /** SCANNING CONTENTS **/ - var ch = this._input[this.offset - 1]; - while (this.offset < this.size) { - if (ch === "\n" || ch === "\r") { - ch = this.input(); - if (this.isDOC_MATCH()) { - this.unput(1).popState(); - this.appendToken(this.tok.T_END_HEREDOC, this.heredoc_label.length); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } - } else { - ch = this.input(); - } - } - // too bad ! reached end of document (will get a parse error) - return this.tok.T_ENCAPSED_AND_WHITESPACE; - }, - - matchST_HEREDOC: function matchST_HEREDOC() { - /** edge case : empty here doc **/ - var ch = this.input(); - if (this.isDOC_MATCH()) { - this.consume(this.heredoc_label.length - 1); - this.popState(); - return this.tok.T_END_HEREDOC; - } - /** SCANNING CONTENTS **/ - while (this.offset < this.size) { - if (ch === "\\") { - ch = this.input(); // ignore next - if (ch !== "\n" && ch !== "\r") { - ch = this.input(); - } - } - - if (ch === "\n" || ch === "\r") { - ch = this.input(); - if (this.isDOC_MATCH()) { - this.unput(1).popState(); - this.appendToken(this.tok.T_END_HEREDOC, this.heredoc_label.length); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } - } else if (ch === "$") { - ch = this.input(); - if (ch === "{") { - // start of ${ - this.begin("ST_LOOKING_FOR_VARNAME"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES, 2); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } - } else if (this.is_LABEL_START()) { - // start of $var... - var yyoffset = this.offset; - var next = this.consume_VARIABLE(); - if (this.yytext.length > this.offset - yyoffset + 2) { - this.appendToken(next, this.offset - yyoffset + 2); - this.unput(this.offset - yyoffset + 2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return next; - } - //console.log(this.yytext); - } - } else if (ch === "{") { - ch = this.input(); - if (ch === "$") { - // start of {$... - this.begin("ST_IN_SCRIPTING"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_CURLY_OPEN, 1); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - this.unput(1); - return this.tok.T_CURLY_OPEN; - } - } - } else { - ch = this.input(); - } - } - - // too bad ! reached end of document (will get a parse error) - return this.tok.T_ENCAPSED_AND_WHITESPACE; - }, - - consume_VARIABLE: function consume_VARIABLE() { - this.consume_LABEL(); - var ch = this.input(); - if (ch == "[") { - this.unput(1); - this.begin("ST_VAR_OFFSET"); - return this.tok.T_VARIABLE; - } else if (ch === "-") { - if (this.input() === ">") { - this.input(); - if (this.is_LABEL_START()) { - this.begin("ST_LOOKING_FOR_PROPERTY"); - } - this.unput(3); - return this.tok.T_VARIABLE; - } else { - this.unput(2); - } - } else { - if (ch) this.unput(1); - } - return this.tok.T_VARIABLE; - }, - // HANDLES BACKQUOTES - matchST_BACKQUOTE: function matchST_BACKQUOTE() { - var ch = this.input(); - if (ch === "$") { - ch = this.input(); - if (ch === "{") { - this.begin("ST_LOOKING_FOR_VARNAME"); - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } else if (this.is_LABEL_START()) { - var tok = this.consume_VARIABLE(); - return tok; - } - } else if (ch === "{") { - if (this._input[this.offset] === "$") { - this.begin("ST_IN_SCRIPTING"); - return this.tok.T_CURLY_OPEN; - } - } else if (ch === "`") { - this.popState(); - return "`"; - } - - // any char - while (this.offset < this.size) { - if (ch === "\\") { - this.input(); - } else if (ch === "`") { - this.unput(1); - this.popState(); - this.appendToken("`", 1); - break; - } else if (ch === "$") { - ch = this.input(); - if (ch === "{") { - this.begin("ST_LOOKING_FOR_VARNAME"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES, 2); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } - } else if (this.is_LABEL_START()) { - // start of $var... - var yyoffset = this.offset; - var next = this.consume_VARIABLE(); - if (this.yytext.length > this.offset - yyoffset + 2) { - this.appendToken(next, this.offset - yyoffset + 2); - this.unput(this.offset - yyoffset + 2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return next; - } - } - continue; - } else if (ch === "{") { - ch = this.input(); - if (ch === "$") { - // start of {$... - this.begin("ST_IN_SCRIPTING"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_CURLY_OPEN, 1); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - this.unput(1); - return this.tok.T_CURLY_OPEN; - } - } - continue; - } - ch = this.input(); - } - return this.tok.T_ENCAPSED_AND_WHITESPACE; - }, - - matchST_DOUBLE_QUOTES: function matchST_DOUBLE_QUOTES() { - var ch = this.input(); - if (ch === "$") { - ch = this.input(); - if (ch === "{") { - this.begin("ST_LOOKING_FOR_VARNAME"); - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } else if (this.is_LABEL_START()) { - var tok = this.consume_VARIABLE(); - return tok; - } - } else if (ch === "{") { - if (this._input[this.offset] === "$") { - this.begin("ST_IN_SCRIPTING"); - return this.tok.T_CURLY_OPEN; - } - } else if (ch === '"') { - this.popState(); - return '"'; - } - - // any char - while (this.offset < this.size) { - if (ch === "\\") { - this.input(); - } else if (ch === '"') { - this.unput(1); - this.popState(); - this.appendToken('"', 1); - break; - } else if (ch === "$") { - ch = this.input(); - if (ch === "{") { - this.begin("ST_LOOKING_FOR_VARNAME"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES, 2); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } - } else if (this.is_LABEL_START()) { - // start of $var... - var yyoffset = this.offset; - var next = this.consume_VARIABLE(); - if (this.yytext.length > this.offset - yyoffset + 2) { - this.appendToken(next, this.offset - yyoffset + 2); - this.unput(this.offset - yyoffset + 2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return next; - } - } - if (ch) this.unput(1); - } else if (ch === "{") { - ch = this.input(); - if (ch === "$") { - // start of {$... - this.begin("ST_IN_SCRIPTING"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_CURLY_OPEN, 1); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - // @fixme : yytext = '"{$' (this.yytext.length > 3) - this.unput(1); - return this.tok.T_CURLY_OPEN; - } - } - if (ch) this.unput(1); - } - ch = this.input(); - } - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } -}; - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - matchST_IN_SCRIPTING: function matchST_IN_SCRIPTING() { - var ch = this.input(); - switch (ch) { - case " ": - case "\t": - case "\n": - case "\r": - case "\r\n": - return this.T_WHITESPACE(); - case "#": - return this.T_COMMENT(); - case "/": - if (this._input[this.offset] === "/") { - return this.T_COMMENT(); - } else if (this._input[this.offset] === "*") { - this.input(); - return this.T_DOC_COMMENT(); - } - return this.consume_TOKEN(); - case "'": - return this.T_CONSTANT_ENCAPSED_STRING(); - case '"': - return this.ST_DOUBLE_QUOTES(); - case "`": - this.begin("ST_BACKQUOTE"); - return "`"; - case "?": - if (!this.aspTagMode && this.tryMatch(">")) { - this.input(); - var nextCH = this._input[this.offset]; - if (nextCH === "\n" || nextCH === "\r") this.input(); - if (this.conditionStack.length > 1) { - this.begin("INITIAL"); - } - return this.tok.T_CLOSE_TAG; - } - return this.consume_TOKEN(); - case "%": - if (this.aspTagMode && this._input[this.offset] === ">") { - this.input(); // consume the '>' - ch = this._input[this.offset]; // read next - if (ch === "\n" || ch === "\r") { - this.input(); // consume the newline - } - this.aspTagMode = false; - if (this.conditionStack.length > 1) { - this.begin("INITIAL"); - } - return this.tok.T_CLOSE_TAG; - } - return this.consume_TOKEN(); - case "{": - this.begin("ST_IN_SCRIPTING"); - return "{"; - case "}": - if (this.conditionStack.length > 2) { - // Return to HEREDOC/ST_DOUBLE_QUOTES mode - this.popState(); - } - return "}"; - default: - if (ch === ".") { - ch = this.input(); - if (this.is_NUM()) { - return this.consume_NUM(); - } else { - if (ch) this.unput(1); - } - } - if (this.is_NUM()) { - return this.consume_NUM(); - } else if (this.is_LABEL_START()) { - return this.consume_LABEL().T_STRING(); - } else if (this.is_TOKEN()) { - return this.consume_TOKEN(); - } - } - throw new Error('Bad terminal sequence "' + ch + '" at line ' + this.yylineno + " (offset " + this.offset + ")"); - }, - - T_WHITESPACE: function T_WHITESPACE() { - while (this.offset < this.size) { - var ch = this.input(); - if (ch === " " || ch === "\t" || ch === "\n" || ch === "\r") { - continue; - } - if (ch) this.unput(1); - break; - } - return this.tok.T_WHITESPACE; - } -}; - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - matchST_LOOKING_FOR_PROPERTY: function matchST_LOOKING_FOR_PROPERTY() { - var ch = this.input(); - if (ch === "-") { - ch = this.input(); - if (ch === ">") { - // https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1296 - return this.tok.T_OBJECT_OPERATOR; - } - if (ch) this.unput(1); - } else if (this.is_WHITESPACE()) { - return this.tok.T_WHITESPACE; - } else if (this.is_LABEL_START()) { - // https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1300 - this.consume_LABEL(); - this.popState(); - return this.tok.T_STRING; - } - // https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1306 - this.popState(); - if (ch) this.unput(1); - return false; - }, - matchST_LOOKING_FOR_VARNAME: function matchST_LOOKING_FOR_VARNAME() { - var ch = this.input(); - - // SHIFT STATE - this.popState(); - this.begin("ST_IN_SCRIPTING"); - - if (this.is_LABEL_START()) { - this.consume_LABEL(); - ch = this.input(); - if (ch === "[" || ch === "}") { - this.unput(1); - return this.tok.T_STRING_VARNAME; - } else { - // any char (that's started with a label sequence) - this.unput(this.yytext.length); - } - } else { - // any char (thats not a label start sequence) - if (ch) this.unput(1); - } - // stops looking for a varname and starts the scripting mode - return false; - }, - matchST_VAR_OFFSET: function matchST_VAR_OFFSET() { - var ch = this.input(); - if (this.is_NUM()) { - this.consume_NUM(); - return this.tok.T_NUM_STRING; - } else if (ch === "]") { - this.popState(); - return "]"; - } else if (ch === "$") { - this.input(); - if (this.is_LABEL_START()) { - this.consume_LABEL(); - return this.tok.T_VARIABLE; - } else { - throw new Error("Unexpected terminal"); - } - } else if (this.is_LABEL_START()) { - this.consume_LABEL(); - return this.tok.T_STRING; - } else if (this.is_WHITESPACE() || ch === "\\" || ch === "'" || ch === "#") { - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else if (ch === "[" || ch === "{" || ch === "}" || ch === '"' || ch === "`" || this.is_TOKEN()) { - return ch; - } else { - throw new Error("Unexpected terminal"); - } - } -}; - -/***/ }), -/* 112 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -/* istanbul ignore else */ - -var MAX_LENGTH_OF_LONG = 10; -var long_min_digits = "2147483648"; -if (process.arch == "x64") { - MAX_LENGTH_OF_LONG = 19; - long_min_digits = "9223372036854775808"; -} - -module.exports = { - consume_NUM: function consume_NUM() { - var ch = this.yytext[0]; - var hasPoint = this.yytext[0] === "."; - if (ch === "0") { - ch = this.input(); - // check if hexa - if (ch === "x" || ch === "X") { - ch = this.input(); - if (this.is_HEX()) { - return this.consume_HNUM(); - } else { - this.unput(ch ? 2 : 1); - } - } else if (ch === "b" || ch === "B") { - ch = this.input(); - if (ch === "0" || ch === "1") { - return this.consume_BNUM(); - } else { - this.unput(ch ? 2 : 1); - } - } else if (!this.is_NUM()) { - if (ch) this.unput(1); - } - } - - while (this.offset < this.size) { - ch = this.input(); - if (!this.is_NUM()) { - if (ch === "." && !hasPoint) { - hasPoint = true; - } else if (ch === "e" || ch === "E") { - ch = this.input(); - if (ch === "+" || ch === "-") { - ch = this.input(); - if (this.is_NUM()) { - this.consume_LNUM(); - return this.tok.T_DNUMBER; - } else { - this.unput(ch ? 3 : 2); - break; - } - } else if (this.is_NUM()) { - this.consume_LNUM(); - return this.tok.T_DNUMBER; - } else { - this.unput(ch ? 2 : 1); - break; - } - } else { - if (ch) this.unput(1); - break; - } - } - } - if (hasPoint) { - return this.tok.T_DNUMBER; - } else if (this.yytext.length < MAX_LENGTH_OF_LONG - 1) { - return this.tok.T_LNUMBER; - } else { - if (this.yytext.length < MAX_LENGTH_OF_LONG || this.yytext.length == MAX_LENGTH_OF_LONG && this.yytext < long_min_digits) { - return this.tok.T_LNUMBER; - } - return this.tok.T_DNUMBER; - } - }, - // read hexa - consume_HNUM: function consume_HNUM() { - while (this.offset < this.size) { - var ch = this.input(); - if (!this.is_HEX()) { - if (ch) this.unput(1); - break; - } - } - return this.tok.T_LNUMBER; - }, - // read a generic number - consume_LNUM: function consume_LNUM() { - while (this.offset < this.size) { - var ch = this.input(); - if (!this.is_NUM()) { - if (ch) this.unput(1); - break; - } - } - return this.tok.T_LNUMBER; - }, - // read binary - consume_BNUM: function consume_BNUM() { - var ch = void 0; - while (this.offset < this.size) { - ch = this.input(); - if (ch !== "0" && ch !== "1") { - if (ch) this.unput(1); - break; - } - } - return this.tok.T_LNUMBER; - } -}; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(112))) - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - nextINITIAL: function nextINITIAL() { - if (this.conditionStack.length > 1 && this.conditionStack[this.conditionStack.length - 1] === "INITIAL") { - // Return to HEREDOC/ST_DOUBLE_QUOTES mode - this.popState(); - } else { - this.begin("ST_IN_SCRIPTING"); - } - return this; - }, - matchINITIAL: function matchINITIAL() { - while (this.offset < this.size) { - var ch = this.input(); - if (ch == "<") { - ch = this.ahead(1); - if (ch == "?") { - if (this.tryMatch("?=")) { - this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO, 3).nextINITIAL(); - break; - } else if (this.tryMatchCaseless("?php")) { - ch = this._input[this.offset + 4]; - if (ch === " " || ch === "\t" || ch === "\n" || ch === "\r") { - this.unput(1).appendToken(this.tok.T_OPEN_TAG, 6).nextINITIAL(); - break; - } - } - if (this.short_tags) { - this.unput(1).appendToken(this.tok.T_OPEN_TAG, 2).nextINITIAL(); - break; - } - } else if (this.asp_tags && ch == "%") { - if (this.tryMatch("%=")) { - this.aspTagMode = true; - this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO, 3).nextINITIAL(); - break; - } else { - this.aspTagMode = true; - this.unput(1).appendToken(this.tok.T_OPEN_TAG, 2).nextINITIAL(); - break; - } - } - } - } - if (this.yytext.length > 0) { - return this.tok.T_INLINE_HTML; - } else { - return false; - } - } -}; - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -module.exports = { - /** - * Reads a single line comment - */ - T_COMMENT: function T_COMMENT() { - while (this.offset < this.size) { - var ch = this.input(); - if (ch === "\n" || ch === "\r") { - return this.tok.T_COMMENT; - } else if (ch === "?" && !this.aspTagMode && this._input[this.offset] === ">") { - this.unput(1); - return this.tok.T_COMMENT; - } else if (ch === "%" && this.aspTagMode && this._input[this.offset] === ">") { - this.unput(1); - return this.tok.T_COMMENT; - } - } - return this.tok.T_COMMENT; - }, - /** - * Behaviour : https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1927 - */ - T_DOC_COMMENT: function T_DOC_COMMENT() { - var ch = this.input(); - var token = this.tok.T_COMMENT; - if (ch === "*") { - // started with '/*' , check is next is '*' - ch = this.input(); - if (this.is_WHITESPACE()) { - // check if next is WHITESPACE - token = this.tok.T_DOC_COMMENT; - } - if (ch === "/") { - return token; - } else { - this.unput(1); // reset - } - } - while (this.offset < this.size) { - ch = this.input(); - if (ch === "*" && this._input[this.offset] === "/") { - this.input(); - break; - } - } - return token; - } -}; - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -/** - * This is the php lexer. It will tokenize the string for helping the - * parser to build the AST from its grammar. - * - * @class - * @property {Integer} EOF - * @property {Boolean} all_tokens defines if all tokens must be retrieved (used by token_get_all only) - * @property {Boolean} comment_tokens extracts comments tokens - * @property {Boolean} mode_eval enables the evald mode (ignore opening tags) - * @property {Boolean} asp_tags disables by default asp tags mode - * @property {Boolean} short_tags enables by default short tags mode - * @property {Object} keywords List of php keyword - * @property {Object} castKeywords List of php keywords for type casting - */ - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var lexer = function lexer(engine) { - this.engine = engine; - this.tok = this.engine.tokens.names; - this.EOF = 1; - this.debug = false; - this.all_tokens = true; - this.comment_tokens = false; - this.mode_eval = false; - this.asp_tags = false; - this.short_tags = true; - this.php7 = true; - this.yyprevcol = 0; - this.keywords = { - __class__: this.tok.T_CLASS_C, - __trait__: this.tok.T_TRAIT_C, - __function__: this.tok.T_FUNC_C, - __method__: this.tok.T_METHOD_C, - __line__: this.tok.T_LINE, - __file__: this.tok.T_FILE, - __dir__: this.tok.T_DIR, - __namespace__: this.tok.T_NS_C, - exit: this.tok.T_EXIT, - die: this.tok.T_EXIT, - function: this.tok.T_FUNCTION, - const: this.tok.T_CONST, - return: this.tok.T_RETURN, - try: this.tok.T_TRY, - catch: this.tok.T_CATCH, - finally: this.tok.T_FINALLY, - throw: this.tok.T_THROW, - if: this.tok.T_IF, - elseif: this.tok.T_ELSEIF, - endif: this.tok.T_ENDIF, - else: this.tok.T_ELSE, - while: this.tok.T_WHILE, - endwhile: this.tok.T_ENDWHILE, - do: this.tok.T_DO, - for: this.tok.T_FOR, - endfor: this.tok.T_ENDFOR, - foreach: this.tok.T_FOREACH, - endforeach: this.tok.T_ENDFOREACH, - declare: this.tok.T_DECLARE, - enddeclare: this.tok.T_ENDDECLARE, - instanceof: this.tok.T_INSTANCEOF, - as: this.tok.T_AS, - switch: this.tok.T_SWITCH, - endswitch: this.tok.T_ENDSWITCH, - case: this.tok.T_CASE, - default: this.tok.T_DEFAULT, - break: this.tok.T_BREAK, - continue: this.tok.T_CONTINUE, - goto: this.tok.T_GOTO, - echo: this.tok.T_ECHO, - print: this.tok.T_PRINT, - class: this.tok.T_CLASS, - interface: this.tok.T_INTERFACE, - trait: this.tok.T_TRAIT, - extends: this.tok.T_EXTENDS, - implements: this.tok.T_IMPLEMENTS, - new: this.tok.T_NEW, - clone: this.tok.T_CLONE, - var: this.tok.T_VAR, - eval: this.tok.T_EVAL, - include: this.tok.T_INCLUDE, - include_once: this.tok.T_INCLUDE_ONCE, - require: this.tok.T_REQUIRE, - require_once: this.tok.T_REQUIRE_ONCE, - namespace: this.tok.T_NAMESPACE, - use: this.tok.T_USE, - insteadof: this.tok.T_INSTEADOF, - global: this.tok.T_GLOBAL, - isset: this.tok.T_ISSET, - empty: this.tok.T_EMPTY, - __halt_compiler: this.tok.T_HALT_COMPILER, - static: this.tok.T_STATIC, - abstract: this.tok.T_ABSTRACT, - final: this.tok.T_FINAL, - private: this.tok.T_PRIVATE, - protected: this.tok.T_PROTECTED, - public: this.tok.T_PUBLIC, - unset: this.tok.T_UNSET, - list: this.tok.T_LIST, - array: this.tok.T_ARRAY, - callable: this.tok.T_CALLABLE, - or: this.tok.T_LOGICAL_OR, - and: this.tok.T_LOGICAL_AND, - xor: this.tok.T_LOGICAL_XOR - }; - this.castKeywords = { - int: this.tok.T_INT_CAST, - integer: this.tok.T_INT_CAST, - real: this.tok.T_DOUBLE_CAST, - double: this.tok.T_DOUBLE_CAST, - float: this.tok.T_DOUBLE_CAST, - string: this.tok.T_STRING_CAST, - binary: this.tok.T_STRING_CAST, - array: this.tok.T_ARRAY_CAST, - object: this.tok.T_OBJECT_CAST, - bool: this.tok.T_BOOL_CAST, - boolean: this.tok.T_BOOL_CAST, - unset: this.tok.T_UNSET_CAST - }; -}; - -/** - * Initialize the lexer with the specified input - */ -lexer.prototype.setInput = function (input) { - this._input = input; - this.size = input.length; - this.yylineno = 1; - this.offset = 0; - this.yyprevcol = 0; - this.yytext = ""; - this.yylloc = { - first_offset: 0, - first_line: 1, - first_column: 0, - prev_offset: 0, - prev_line: 1, - prev_column: 0, - last_line: 1, - last_column: 0 - }; - this.tokens = []; - this.done = this.offset >= this.size; - if (!this.all_tokens && this.mode_eval) { - this.conditionStack = ["INITIAL"]; - this.begin("ST_IN_SCRIPTING"); - } else { - this.conditionStack = []; - this.begin("INITIAL"); - } - return this; -}; - -/** - * consumes and returns one char from the input - */ -lexer.prototype.input = function () { - var ch = this._input[this.offset]; - if (!ch) return ""; - this.yytext += ch; - this.offset++; - if (ch === "\r" && this._input[this.offset] === "\n") { - this.yytext += "\n"; - this.offset++; - } - if (ch === "\n" || ch === "\r") { - this.yylloc.last_line = ++this.yylineno; - this.yyprevcol = this.yylloc.last_column; - this.yylloc.last_column = 0; - } else { - this.yylloc.last_column++; - } - return ch; -}; - -/** - * revert eating specified size - */ -lexer.prototype.unput = function (size) { - if (size === 1) { - // 1 char unput (most cases) - this.offset--; - if (this._input[this.offset] === "\n" && this._input[this.offset - 1] === "\r") { - this.offset--; - size++; - } - if (this._input[this.offset] === "\r" || this._input[this.offset] === "\n") { - this.yylloc.last_line--; - this.yylineno--; - this.yylloc.last_column = this.yyprevcol; - } else { - this.yylloc.last_column--; - } - this.yytext = this.yytext.substring(0, this.yytext.length - size); - } else if (size > 0) { - this.offset -= size; - if (size < this.yytext.length) { - this.yytext = this.yytext.substring(0, this.yytext.length - size); - // re-calculate position - this.yylloc.last_line = this.yylloc.first_line; - this.yylloc.last_column = this.yyprevcol = this.yylloc.first_column; - for (var i = 0; i < this.yytext.length; i++) { - var c = this.yytext[i]; - if (c === "\r") { - c = this.yytext[++i]; - this.yyprevcol = this.yylloc.last_column; - this.yylloc.last_line++; - this.yylloc.last_column = 0; - if (c !== "\n") { - if (c === "\r") { - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - } - } else if (c === "\n") { - this.yyprevcol = this.yylloc.last_column; - this.yylloc.last_line++; - this.yylloc.last_column = 0; - } else { - this.yylloc.last_column++; - } - } - this.yylineno = this.yylloc.last_line; - } else { - // reset full text - this.yytext = ""; - this.yylloc.last_line = this.yylineno = this.yylloc.first_line; - this.yylloc.last_column = this.yylloc.first_column; - } - } - - return this; -}; - -// check if the text matches -lexer.prototype.tryMatch = function (text) { - return text === this.ahead(text.length); -}; - -// check if the text matches -lexer.prototype.tryMatchCaseless = function (text) { - return text === this.ahead(text.length).toLowerCase(); -}; - -// look ahead -lexer.prototype.ahead = function (size) { - var text = this._input.substring(this.offset, this.offset + size); - if (text[text.length - 1] === "\r" && this._input[this.offset + size + 1] === "\n") { - text += "\n"; - } - return text; -}; - -// consume the specified size -lexer.prototype.consume = function (size) { - for (var i = 0; i < size; i++) { - var ch = this._input[this.offset]; - if (!ch) break; - this.yytext += ch; - this.offset++; - if (ch === "\r" && this._input[this.offset] === "\n") { - this.yytext += "\n"; - this.offset++; - i++; - } - if (ch === "\n" || ch === "\r") { - this.yylloc.last_line = ++this.yylineno; - this.yyprevcol = this.yylloc.last_column; - this.yylloc.last_column = 0; - } else { - this.yylloc.last_column++; - } - } - return this; -}; - -/** - * Gets the current state - */ -lexer.prototype.getState = function () { - return { - yytext: this.yytext, - offset: this.offset, - yylineno: this.yylineno, - yyprevcol: this.yyprevcol, - yylloc: { - first_offset: this.yylloc.first_offset, - first_line: this.yylloc.first_line, - first_column: this.yylloc.first_column, - last_line: this.yylloc.last_line, - last_column: this.yylloc.last_column - } - }; -}; - -/** - * Sets the current lexer state - */ -lexer.prototype.setState = function (state) { - this.yytext = state.yytext; - this.offset = state.offset; - this.yylineno = state.yylineno; - this.yyprevcol = state.yyprevcol; - this.yylloc = state.yylloc; - return this; -}; - -// prepend next token -lexer.prototype.appendToken = function (value, ahead) { - this.tokens.push([value, ahead]); - return this; -}; - -// return next match that has a token -lexer.prototype.lex = function () { - this.yylloc.prev_offset = this.offset; - this.yylloc.prev_line = this.yylloc.last_line; - this.yylloc.prev_column = this.yylloc.last_column; - var token = this.next() || this.lex(); - if (!this.all_tokens) { - while (token === this.tok.T_WHITESPACE || // ignore white space - !this.comment_tokens && (token === this.tok.T_COMMENT || // ignore single lines comments - token === this.tok.T_DOC_COMMENT) || // ignore doc comments - // ignore open tags - token === this.tok.T_OPEN_TAG) { - token = this.next() || this.lex(); - } - if (token == this.tok.T_OPEN_TAG_WITH_ECHO) { - // https://github.com/php/php-src/blob/7ff186434e82ee7be7c59d0db9a976641cf7b09c/Zend/zend_compile.c#L1683 - // open tag with echo statement - return this.tok.T_ECHO; - } else if (token === this.tok.T_CLOSE_TAG) { - // https://github.com/php/php-src/blob/7ff186434e82ee7be7c59d0db9a976641cf7b09c/Zend/zend_compile.c#L1680 - return ";"; /* implicit ; */ - } - } - if (!this.yylloc.prev_offset) { - this.yylloc.prev_offset = this.yylloc.first_offset; - this.yylloc.prev_line = this.yylloc.first_line; - this.yylloc.prev_column = this.yylloc.first_column; - } - /*else if (this.yylloc.prev_offset === this.offset && this.offset !== this.size) { - throw new Error('Infinite loop @ ' + this.offset + ' / ' + this.size); - }*/ - return token; -}; - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -lexer.prototype.begin = function (condition) { - this.conditionStack.push(condition); - this.curCondition = condition; - this.stateCb = this["match" + condition]; - if (typeof this.stateCb !== "function") { - throw new Error('Undefined condition state "' + condition + '"'); - } - return this; -}; - -// pop the previously active lexer condition state off the condition stack -lexer.prototype.popState = function () { - var n = this.conditionStack.length - 1; - var condition = n > 0 ? this.conditionStack.pop() : this.conditionStack[0]; - this.curCondition = this.conditionStack[this.conditionStack.length - 1]; - this.stateCb = this["match" + this.curCondition]; - if (typeof this.stateCb !== "function") { - throw new Error('Undefined condition state "' + this.curCondition + '"'); - } - return condition; -}; - -// return next match in input -lexer.prototype.next = function () { - var token = void 0; - if (!this._input) { - this.done = true; - } - this.yylloc.first_offset = this.offset; - this.yylloc.first_line = this.yylloc.last_line; - this.yylloc.first_column = this.yylloc.last_column; - this.yytext = ""; - if (this.done) { - this.yylloc.prev_offset = this.yylloc.first_offset; - this.yylloc.prev_line = this.yylloc.first_line; - this.yylloc.prev_column = this.yylloc.first_column; - return this.EOF; - } - if (this.tokens.length > 0) { - token = this.tokens.shift(); - if (_typeof(token[1]) === "object") { - this.setState(token[1]); - } else { - this.consume(token[1]); - } - token = token[0]; - } else { - token = this.stateCb.apply(this, []); - } - if (this.offset >= this.size && this.tokens.length === 0) { - this.done = true; - } - if (this.debug) { - var tName = token; - if (typeof tName === "number") { - tName = this.engine.tokens.values[tName]; - } else { - tName = '"' + tName + '"'; - } - var e = new Error(tName + "\tfrom " + this.yylloc.first_line + "," + this.yylloc.first_column + "\t - to " + this.yylloc.last_line + "," + this.yylloc.last_column + '\t"' + this.yytext + '"'); - // eslint-disable-next-line no-console - console.error(e.stack); - } - return token; -}; - -// extends the lexer with states -[__webpack_require__(115), __webpack_require__(114), __webpack_require__(113), __webpack_require__(111), __webpack_require__(110), __webpack_require__(109), __webpack_require__(108), __webpack_require__(107)].forEach(function (ext) { - for (var k in ext) { - lexer.prototype[k] = ext[k]; - } -}); - -module.exports = lexer; - -/***/ }), -/* 117 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - - -/***/ }), -/* 118 */ -/***/ (function(module, exports) { - -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d - - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } - - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} - - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -// Support decoding URL-safe base64 strings, as Node.js does. -// See: https://en.wikipedia.org/wiki/Base64#URL_applications -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function getLens (b64) { - var len = b64.length - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - for (var i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk( - uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) - )) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} - - -/***/ }), -/* 120 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1, eval)("this"); -} catch (e) { - // This works if the window reference is available - if (typeof window === "object") g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -/* eslint-disable no-proto */ - - - -var base64 = __webpack_require__(119) -var ieee754 = __webpack_require__(118) -var isArray = __webpack_require__(117) - -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 - -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. - - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ -Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined - ? global.TYPED_ARRAY_SUPPORT - : typedArraySupport() - -/* - * Export kMaxLength after typed array support is determined. - */ -exports.kMaxLength = kMaxLength() - -function typedArraySupport () { - try { - var arr = new Uint8Array(1) - arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} - return arr.foo() === 42 && // typed array instances can be augmented - typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` - arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` - } catch (e) { - return false - } -} - -function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff -} - -function createBuffer (that, length) { - if (kMaxLength() < length) { - throw new RangeError('Invalid typed array length') - } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = new Uint8Array(length) - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - if (that === null) { - that = new Buffer(length) - } - that.length = length - } - - return that -} - -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - -function Buffer (arg, encodingOrOffset, length) { - if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { - return new Buffer(arg, encodingOrOffset, length) - } - - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' - ) - } - return allocUnsafe(this, arg) - } - return from(this, arg, encodingOrOffset, length) -} - -Buffer.poolSize = 8192 // not used by this implementation - -// TODO: Legacy, not needed anymore. Remove in next major version. -Buffer._augment = function (arr) { - arr.__proto__ = Buffer.prototype - return arr -} - -function from (that, value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) - } - - return fromObject(that, value) -} - -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(null, value, encodingOrOffset, length) -} - -if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype - Buffer.__proto__ = Uint8Array - if (typeof Symbol !== 'undefined' && Symbol.species && - Buffer[Symbol.species] === Buffer) { - // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true - }) - } -} - -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } -} - -function alloc (that, size, fill, encoding) { - assertSize(size) - if (size <= 0) { - return createBuffer(that, size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(that, size).fill(fill, encoding) - : createBuffer(that, size).fill(fill) - } - return createBuffer(that, size) -} - -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(null, size, fill, encoding) -} - -function allocUnsafe (that, size) { - assertSize(size) - that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < size; ++i) { - that[i] = 0 - } - } - return that -} - -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(null, size) -} -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(null, size) -} - -function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - var length = byteLength(string, encoding) | 0 - that = createBuffer(that, length) - - var actual = that.write(string, encoding) - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - that = that.slice(0, actual) - } - - return that -} - -function fromArrayLike (that, array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0 - that = createBuffer(that, length) - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -function fromArrayBuffer (that, array, byteOffset, length) { - array.byteLength // this throws if `array` is not a valid ArrayBuffer - - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('\'length\' is out of bounds') - } - - if (byteOffset === undefined && length === undefined) { - array = new Uint8Array(array) - } else if (length === undefined) { - array = new Uint8Array(array, byteOffset) - } else { - array = new Uint8Array(array, byteOffset, length) - } - - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = array - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - that = fromArrayLike(that, array) - } - return that -} - -function fromObject (that, obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0 - that = createBuffer(that, len) - - if (that.length === 0) { - return that - } - - obj.copy(that, 0, 0, len) - return that - } - - if (obj) { - if ((typeof ArrayBuffer !== 'undefined' && - obj.buffer instanceof ArrayBuffer) || 'length' in obj) { - if (typeof obj.length !== 'number' || isnan(obj.length)) { - return createBuffer(that, 0) - } - return fromArrayLike(that, obj) - } - - if (obj.type === 'Buffer' && isArray(obj.data)) { - return fromArrayLike(that, obj.data) - } - } - - throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') -} - -function checked (length) { - // Note: cannot use `length < kMaxLength()` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') - } - return length | 0 -} - -function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0 - } - return Buffer.alloc(+length) -} - -Buffer.isBuffer = function isBuffer (b) { - return !!(b != null && b._isBuffer) -} - -Buffer.compare = function compare (a, b) { - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - - var x = a.length - var y = b.length - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } -} - -Buffer.concat = function concat (list, length) { - if (!isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; ++i) { - length += list[i].length - } - } - - var buffer = Buffer.allocUnsafe(length) - var pos = 0 - for (i = 0; i < list.length; ++i) { - var buf = list[i] - if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos) - pos += buf.length - } - return buffer -} - -function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && - (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - string = '' + string - } - - var len = string.length - if (len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - case undefined: - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} -Buffer.byteLength = byteLength - -function slowToString (encoding, start, end) { - var loweredCase = false - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0 - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length - } - - if (end <= 0) { - return '' - } - - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0 - start >>>= 0 - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8' - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } - } -} - -// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect -// Buffer instances. -Buffer.prototype._isBuffer = true - -function swap (b, n, m) { - var i = b[n] - b[n] = b[m] - b[m] = i -} - -Buffer.prototype.swap16 = function swap16 () { - var len = this.length - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1) - } - return this -} - -Buffer.prototype.swap32 = function swap32 () { - var len = this.length - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3) - swap(this, i + 1, i + 2) - } - return this -} - -Buffer.prototype.swap64 = function swap64 () { - var len = this.length - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7) - swap(this, i + 1, i + 6) - swap(this, i + 2, i + 5) - swap(this, i + 3, i + 4) - } - return this -} - -Buffer.prototype.toString = function toString () { - var length = this.length | 0 - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} - -Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -} - -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') - if (this.length > max) str += ' ... ' - } - return '' -} - -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (!Buffer.isBuffer(target)) { - throw new TypeError('Argument must be a Buffer') - } - - if (start === undefined) { - start = 0 - } - if (end === undefined) { - end = target ? target.length : 0 - } - if (thisStart === undefined) { - thisStart = 0 - } - if (thisEnd === undefined) { - thisEnd = this.length - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0 - end >>>= 0 - thisStart >>>= 0 - thisEnd >>>= 0 - - if (this === target) return 0 - - var x = thisEnd - thisStart - var y = end - start - var len = Math.min(x, y) - - var thisCopy = this.slice(thisStart, thisEnd) - var targetCopy = target.slice(start, end) - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i] - y = targetCopy[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset - byteOffset = 0 - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000 - } - byteOffset = +byteOffset // Coerce to Number. - if (isNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1) - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1 - } else if (byteOffset < 0) { - if (dir) byteOffset = 0 - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF // Search for a byte value [0-255] - if (Buffer.TYPED_ARRAY_SUPPORT && - typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') -} - -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1 - var arrLength = arr.length - var valLength = val.length - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase() - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2 - arrLength /= 2 - valLength /= 2 - byteOffset /= 2 - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i - if (dir) { - var foundIndex = -1 - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex - foundIndex = -1 - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength - for (i = byteOffset; i >= 0; i--) { - var found = true - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false - break - } - } - if (found) return i - } - } - - return -1 -} - -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -} - -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -} - -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -} - -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0 - var remaining = buf.length - offset - if (!length) { - length = remaining - } else { - length = Number(length) - if (length > remaining) { - length = remaining - } - } - - // must be an even number of digits - var strLen = string.length - if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') - - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (isNaN(parsed)) return i - buf[offset + i] = parsed - } - return i -} - -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} - -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} - -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} - -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} - -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} - -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8' - length = this.length - offset = 0 - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset - length = this.length - offset = 0 - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0 - if (isFinite(length)) { - length = length | 0 - if (encoding === undefined) encoding = 'utf8' - } else { - encoding = length - length = undefined - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8' - - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} - -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -} - -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} - -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] - - var i = start - while (i < end) { - var firstByte = buf[i] - var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[i + 1] - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - fourthByte = buf[i + 3] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD - bytesPerSequence = 1 - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3FF | 0xD800) - codePoint = 0xDC00 | codePoint & 0x3FF - } - - res.push(codePoint) - i += bytesPerSequence - } - - return decodeCodePointsArray(res) -} - -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000 - -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = '' - var i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) - } - return res -} - -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} - -function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) - } - return ret -} - -function hexSlice (buf, start, end) { - var len = buf.length - - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len - - var out = '' - for (var i = start; i < end; ++i) { - out += toHex(buf[i]) - } - return out -} - -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end) - var res = '' - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) - } - return res -} - -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end - - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len - } - - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } - - if (end < start) end = start - - var newBuf - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = this.subarray(start, end) - newBuf.__proto__ = Buffer.prototype - } else { - var sliceLen = end - start - newBuf = new Buffer(sliceLen, undefined) - for (var i = 0; i < sliceLen; ++i) { - newBuf[i] = this[i + start] - } - } - - return newBuf -} - -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} - -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - - return val -} - -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } - - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul - } - - return val -} - -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] -} - -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) -} - -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} - -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -} - -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -} - -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} - -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} - -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -} - -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) -} - -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) -} - -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) -} - -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) -} - -function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} - -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - this[offset] = (value & 0xff) - return offset + 1 -} - -function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8 - } -} - -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff - } -} - -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = 0 - var mul = 1 - var sub = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = byteLength - 1 - var mul = 1 - var sub = 0 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} - -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (value < 0) value = 0xffffffff + value + 1 - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} - -function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) - } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 -} - -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -} - -function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) - } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} - -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0 - if (!end && end !== 0) end = this.length - if (targetStart >= target.length) targetStart = target.length - if (!targetStart) targetStart = 0 - if (end > 0 && end < start) end = start - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } - - var len = end - start - var i - - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start] - } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start] - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, start + len), - targetStart - ) - } - - return len -} - -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start - start = 0 - end = this.length - } else if (typeof end === 'string') { - encoding = end - end = this.length - } - if (val.length === 1) { - var code = val.charCodeAt(0) - if (code < 256) { - val = code - } - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - } else if (typeof val === 'number') { - val = val & 255 - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0 - end = end === undefined ? this.length : end >>> 0 - - if (!val) val = 0 - - var i - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : utf8ToBytes(new Buffer(val, encoding).toString()) - var len = bytes.length - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len] - } - } - - return this -} - -// HELPER FUNCTIONS -// ================ - -var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g - -function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, '') - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '=' - } - return str -} - -function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') -} - -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} - -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i) - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } - - // valid lead - leadSurrogate = codePoint - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - } - - leadSurrogate = null - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint) - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else { - throw new Error('Invalid code point') - } - } - - return bytes -} - -function asciiToBytes (str) { - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF) - } - return byteArray -} - -function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } - - return byteArray -} - -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} - -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i] - } - return i -} - -function isnan (val) { - return val !== val // eslint-disable-line no-self-compare -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(120))) - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Buffer) {/*! - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var lexer = __webpack_require__(116); -var parser = __webpack_require__(106); -var tokens = __webpack_require__(90); -var AST = __webpack_require__(89); - -/** - * @private - */ -function combine(src, to) { - var keys = Object.keys(src); - var i = keys.length; - while (i--) { - var k = keys[i]; - var val = src[k]; - if (val === null) { - delete to[k]; - } else if (typeof val === "function") { - to[k] = val.bind(to); - } else if (Array.isArray(val)) { - to[k] = Array.isArray(to[k]) ? to[k].concat(val) : val; - } else if ((typeof val === "undefined" ? "undefined" : _typeof(val)) === "object") { - to[k] = _typeof(to[k]) === "object" ? combine(val, to[k]) : val; - } else { - to[k] = val; - } - } - return to; -} - -/** - * Initialise a new parser instance with the specified options - * - * @class - * @tutorial Engine - * @example - * var parser = require('php-parser'); - * var instance = new parser({ - * parser: { - * extractDoc: true, - * suppressErrors: true, - * php7: true - * }, - * ast: { - * withPositions: true - * }, - * lexer: { - * short_tags: true, - * asp_tags: true - * } - * }); - * - * var evalAST = instance.parseEval('some php code'); - * var codeAST = instance.parseCode(' Note that the output tokens are *STRICLY* similar to PHP function `token_get_all` - * @param {String} buffer - * @return {String[]} - Each item can be a string or an array with following informations [token_name, text, line_number] - */ -engine.prototype.tokenGetAll = function (buffer) { - this.lexer.mode_eval = false; - this.lexer.all_tokens = true; - buffer = getStringBuffer(buffer); - var EOF = this.lexer.EOF; - var names = this.tokens.values; - this.lexer.setInput(buffer); - var token = this.lexer.lex() || EOF; - var result = []; - while (token != EOF) { - var entry = this.lexer.yytext; - if (names.hasOwnProperty(token)) { - entry = [names[token], entry, this.lexer.yylloc.first_line]; - } - result.push(entry); - token = this.lexer.lex() || EOF; - } - return result; -}; - -// exports the function -module.exports = engine; - -// makes libraries public -module.exports.tokens = tokens; -module.exports.lexer = lexer; -module.exports.AST = AST; -module.exports.parser = parser; -module.exports.combine = combine; - -// allow the default export in index.d.ts -module.exports.default = engine; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(121).Buffer)) - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/dist/php-parser.min.js b/dist/php-parser.min.js deleted file mode 100644 index 997304307..000000000 --- a/dist/php-parser.min.js +++ /dev/null @@ -1,23 +0,0 @@ -/*! - * - * Package: php-parser - * Parse PHP code and returns its AST - * Build: 40e3f5cb8f8a414e42e0 - 2018-8-17 - * License: BSD-3-Clause - * Author: Ioan CHIRIAC - * - */ -!function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.PhpParser=factory():root.PhpParser=factory()}(window,function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=122)}([function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Statement=Node.extends(function Statement(kind,docs,location){Node.apply(this,[kind||"statement",docs,location])});module.exports=Statement},function(module,exports,__webpack_require__){"use strict";var Node=function Node(kind,docs,location){this.kind=kind,docs&&(this.leadingComments=docs),location&&(this.loc=location)};Node.prototype.includeToken=function(parser){return this.loc&&(this.loc.end&&(this.loc.end.line=parser.lexer.yylloc.last_line,this.loc.end.column=parser.lexer.yylloc.last_column,this.loc.end.offset=parser.lexer.offset),parser.ast.withSource&&(this.loc.source=parser.lexer._input.substring(this.loc.start.offset,parser.lexer.offset))),this},Node.extends=function(constructor){return constructor.prototype=Object.create(this.prototype),constructor.extends=this.extends,constructor.prototype.constructor=constructor,constructor},module.exports=Node},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Expression=Node.extends(function Expression(kind,docs,location){Node.apply(this,[kind||"expression",docs,location])});module.exports=Expression},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Declaration=Statement.extends(function Declaration(kind,name,docs,location){Statement.apply(this,[kind||"declaration",docs,location]),this.name=name});Declaration.prototype.parseFlags=function(flags){this.isAbstract=1===flags[2],this.isFinal=2===flags[2],"class"!==this.kind&&(-1===flags[0]?this.visibility="":0===flags[0]?this.visibility="public":1===flags[0]?this.visibility="protected":2===flags[0]&&(this.visibility="private"),this.isStatic=1===flags[1])},module.exports=Declaration},function(module,exports,__webpack_require__){"use strict";var Expr=__webpack_require__(2),Literal=Expr.extends(function Literal(kind,value,raw,docs,location){Expr.apply(this,[kind||"literal",docs,location]),this.value=value,raw&&(this.raw=raw)});module.exports=Literal},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Sys=Statement.extends(function Sys(kind,args,docs,location){Statement.apply(this,[kind||"sys",docs,location]),this.arguments=args});module.exports=Sys},function(module,exports,__webpack_require__){"use strict";var Expr=__webpack_require__(2),Operation=Expr.extends(function Operation(kind,docs,location){Expr.apply(this,[kind||"operation",docs,location])});module.exports=Operation},function(module,exports,__webpack_require__){"use strict";var Expr=__webpack_require__(2),Lookup=Expr.extends(function Lookup(kind,what,offset,docs,location){Expr.apply(this,[kind||"lookup",docs,location]),this.what=what,this.offset=offset});module.exports=Lookup},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Block=Statement.extends(function Block(kind,children,docs,location){Statement.apply(this,[kind||"block",docs,location]),this.children=children.filter(Boolean)});module.exports=Block},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Comment=Node.extends(function Comment(kind,value,docs,location){Node.apply(this,[kind,docs,location]),this.value=value});module.exports=Comment},function(module,exports,__webpack_require__){"use strict";var Declaration=__webpack_require__(3),fn=Declaration.extends(function _Function(name,args,byref,type,nullable,docs,location){Declaration.apply(this,["function",name,docs,location]),this.arguments=args,this.byref=byref,this.type=type,this.nullable=nullable,this.body=null});module.exports=fn},function(module,exports,__webpack_require__){"use strict";var Declaration=__webpack_require__(3),Constant=Declaration.extends(function Constant(name,value,docs,location){Declaration.apply(this,["constant",name,docs,location]),this.value=value});module.exports=Constant},function(module,exports,__webpack_require__){"use strict";var Expression=__webpack_require__(2),YieldFrom=Expression.extends(function YieldFrom(value,docs,location){Expression.apply(this,["yieldfrom",docs,location]),this.value=value});module.exports=YieldFrom},function(module,exports,__webpack_require__){"use strict";var Expression=__webpack_require__(2),Yield=Expression.extends(function Yield(value,key,docs,location){Expression.apply(this,["yield",docs,location]),this.value=value,this.key=key});module.exports=Yield},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),While=Statement.extends(function While(test,body,shortForm,docs,location){Statement.apply(this,["while",docs,location]),this.test=test,this.body=body,this.shortForm=shortForm});module.exports=While},function(module,exports,__webpack_require__){"use strict";var Expr=__webpack_require__(2),variadic=Expr.extends(function variadic(what,docs,location){Expr.apply(this,["variadic",docs,location]),this.what=what});module.exports=variadic},function(module,exports,__webpack_require__){"use strict";var Expr=__webpack_require__(2),Variable=Expr.extends(function Variable(name,byref,curly,docs,location){Expr.apply(this,["variable",docs,location]),this.name=name,this.byref=byref||!1,this.curly=curly||!1});module.exports=Variable},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),UseItem=Statement.extends(function UseItem(name,alias,type,docs,location){Statement.apply(this,["useitem",docs,location]),this.name=name,this.alias=alias,this.type=type});UseItem.TYPE_CONST="const",UseItem.TYPE_FUNCTION="function",module.exports=UseItem},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),UseGroup=Statement.extends(function UseGroup(name,type,items,docs,location){Statement.apply(this,["usegroup",docs,location]),this.name=name,this.type=type,this.items=items});module.exports=UseGroup},function(module,exports,__webpack_require__){"use strict";var Sys=__webpack_require__(5),Unset=Sys.extends(function Unset(args,docs,location){Sys.apply(this,["unset",args,docs,location])});module.exports=Unset},function(module,exports,__webpack_require__){"use strict";var Operation=__webpack_require__(6),Unary=Operation.extends(function Unary(type,what,docs,location){Operation.apply(this,["unary",docs,location]),this.type=type,this.what=what});module.exports=Unary},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Try=Statement.extends(function Try(body,catches,always,docs,location){Statement.apply(this,["try",docs,location]),this.body=body,this.catches=catches,this.always=always});module.exports=Try},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),TraitUse=Node.extends(function TraitUse(traits,adaptations,docs,location){Node.apply(this,["traituse",docs,location]),this.traits=traits,this.adaptations=adaptations});module.exports=TraitUse},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),TraitPrecedence=Node.extends(function TraitPrecedence(trait,method,instead,docs,location){Node.apply(this,["traitprecedence",docs,location]),this.trait=trait,this.method=method,this.instead=instead});module.exports=TraitPrecedence},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),TraitAlias=Node.extends(function TraitAlias(trait,method,as,flags,docs,location){Node.apply(this,["traitalias",docs,location]),this.trait=trait,this.method=method,this.as=as,this.visibility="",flags&&(0===flags[0]?this.visibility="public":1===flags[0]?this.visibility="protected":2===flags[0]&&(this.visibility="private"))});module.exports=TraitAlias},function(module,exports,__webpack_require__){"use strict";var Declaration=__webpack_require__(3),Trait=Declaration.extends(function Trait(name,ext,impl,body,docs,location){Declaration.apply(this,["trait",name,docs,location]),this.extends=ext,this.implements=impl,this.body=body});module.exports=Trait},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Throw=Statement.extends(function Throw(what,docs,location){Statement.apply(this,["throw",docs,location]),this.what=what});module.exports=Throw},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Switch=Statement.extends(function Switch(test,body,shortForm,docs,location){Statement.apply(this,["switch",docs,location]),this.test=test,this.body=body,this.shortForm=shortForm});module.exports=Switch},function(module,exports,__webpack_require__){"use strict";var Literal=__webpack_require__(4),String=Literal.extends(function String(isDoubleQuote,value,unicode,raw,docs,location){Literal.apply(this,["string",value,raw,docs,location]),this.unicode=unicode,this.isDoubleQuote=isDoubleQuote});module.exports=String},function(module,exports,__webpack_require__){"use strict";var Lookup=__webpack_require__(7),StaticLookup=Lookup.extends(function StaticLookup(what,offset,docs,location){Lookup.apply(this,["staticlookup",what,offset,docs,location])});module.exports=StaticLookup},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Static=Statement.extends(function Static(items,docs,location){Statement.apply(this,["static",docs,location]),this.items=items});module.exports=Static},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Silent=Statement.extends(function Silent(expr,docs,location){Statement.apply(this,["silent",docs,location]),this.expr=expr});module.exports=Silent},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Return=Node.extends(function Return(expr,docs,location){Node.apply(this,["return",docs,location]),this.expr=expr});module.exports=Return},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),RetIf=Statement.extends(function RetIf(test,trueExpr,falseExpr,docs,location){Statement.apply(this,["retif",docs,location]),this.test=test,this.trueExpr=trueExpr,this.falseExpr=falseExpr});module.exports=RetIf},function(module,exports,__webpack_require__){"use strict";var Lookup=__webpack_require__(7),PropertyLookup=Lookup.extends(function PropertyLookup(what,offset,docs,location){Lookup.apply(this,["propertylookup",what,offset,docs,location])});module.exports=PropertyLookup},function(module,exports,__webpack_require__){"use strict";var Declaration=__webpack_require__(3),Property=Declaration.extends(function Property(name,value,flags,docs,location){Declaration.apply(this,["property",name,docs,location]),this.value=value,this.parseFlags(flags)});module.exports=Property},function(module,exports,__webpack_require__){"use strict";var Block=__webpack_require__(8),Program=Block.extends(function Program(children,errors,comments,tokens,docs,location){Block.apply(this,["program",children,docs,location]),this.errors=errors,comments&&(this.comments=comments),tokens&&(this.tokens=tokens)});module.exports=Program},function(module,exports,__webpack_require__){"use strict";var Sys=__webpack_require__(5),Print=Sys.extends(function Print(args,docs,location){Sys.apply(this,["print",args,docs,location])});module.exports=Print},function(module,exports,__webpack_require__){"use strict";var Operation=__webpack_require__(6),Pre=Operation.extends(function Pre(type,what,docs,location){Operation.apply(this,["pre",docs,location]),this.type=type,this.what=what});module.exports=Pre},function(module,exports,__webpack_require__){"use strict";var Operation=__webpack_require__(6),Post=Operation.extends(function Post(type,what,docs,location){Operation.apply(this,["post",docs,location]),this.type=type,this.what=what});module.exports=Post},function(module,exports,__webpack_require__){"use strict";var Declaration=__webpack_require__(3),Parameter=Declaration.extends(function Parameter(name,type,value,isRef,isVariadic,nullable,docs,location){Declaration.apply(this,["parameter",name,docs,location]),this.value=value,this.type=type,this.byref=isRef,this.variadic=isVariadic,this.nullable=nullable});module.exports=Parameter},function(module,exports,__webpack_require__){"use strict";var Lookup=__webpack_require__(7),OffsetLookup=Lookup.extends(function OffsetLookup(what,offset,docs,location){Lookup.apply(this,["offsetlookup",what,offset,docs,location])});module.exports=OffsetLookup},function(module,exports,__webpack_require__){"use strict";var Literal=__webpack_require__(4),_Number=Literal.extends(function Number(value,raw,docs,location){Literal.apply(this,["number",value,raw,docs,location])});module.exports=_Number},function(module,exports,__webpack_require__){"use strict";var Literal=__webpack_require__(4),Nowdoc=Literal.extends(function Nowdoc(value,raw,label,quote,docs,location){Literal.apply(this,["nowdoc",value,raw,docs,location]),this.label=label,this.quote=quote});module.exports=Nowdoc},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),New=Statement.extends(function New(what,args,docs,location){Statement.apply(this,["new",docs,location]),this.what=what,this.arguments=args});module.exports=New},function(module,exports,__webpack_require__){"use strict";var Block=__webpack_require__(8),Namespace=Block.extends(function Namespace(name,children,withBrackets,docs,location){Block.apply(this,["namespace",children,docs,location]),this.name=name,this.withBrackets=withBrackets||!1});module.exports=Namespace},function(module,exports,__webpack_require__){"use strict";var fn=__webpack_require__(10),Method=fn.extends(function Method(){fn.apply(this,arguments),this.kind="method"});module.exports=Method},function(module,exports,__webpack_require__){"use strict";var Literal=__webpack_require__(4),Magic=Literal.extends(function Magic(value,raw,docs,location){Literal.apply(this,["magic",value,raw,docs,location])});module.exports=Magic},function(module,exports,__webpack_require__){"use strict";var Sys=__webpack_require__(5),List=Sys.extends(function List(items,shortForm,docs,location){Sys.apply(this,["list",items,docs,location]),this.shortForm=shortForm});module.exports=List},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Label=Node.extends(function Label(name,docs,location){Node.apply(this,["label",docs,location]),this.name=name});module.exports=Label},function(module,exports,__webpack_require__){"use strict";var Sys=__webpack_require__(5),Isset=Sys.extends(function Isset(args,docs,location){Sys.apply(this,["isset",args,docs,location])});module.exports=Isset},function(module,exports,__webpack_require__){"use strict";var Declaration=__webpack_require__(3),Interface=Declaration.extends(function Interface(name,ext,body,docs,location){Declaration.apply(this,["interface",name,docs,location]),this.extends=ext,this.body=body});module.exports=Interface},function(module,exports,__webpack_require__){"use strict";var Literal=__webpack_require__(4),Inline=Literal.extends(function Inline(value,raw,docs,location){Literal.apply(this,["inline",value,raw,docs,location])});module.exports=Inline},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Include=Statement.extends(function Include(once,require,target,docs,location){Statement.apply(this,["include",docs,location]),this.once=once,this.require=require,this.target=target});module.exports=Include},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),If=Statement.extends(function If(test,body,alternate,shortForm,docs,location){Statement.apply(this,["if",docs,location]),this.test=test,this.body=body,this.alternate=alternate,this.shortForm=shortForm});module.exports=If},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Identifier=Node.extends(function Identifier(name,isRelative,docs,location){Node.apply(this,["identifier",docs,location]),isRelative?this.resolution=Identifier.RELATIVE_NAME:1===name.length?this.resolution=Identifier.UNQUALIFIED_NAME:""===name[0]?this.resolution=Identifier.FULL_QUALIFIED_NAME:this.resolution=Identifier.QUALIFIED_NAME,this.name=name.join("\\")});Identifier.UNQUALIFIED_NAME="uqn",Identifier.QUALIFIED_NAME="qn",Identifier.FULL_QUALIFIED_NAME="fqn",Identifier.RELATIVE_NAME="rn",module.exports=Identifier},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Halt=Statement.extends(function Halt(after,docs,location){Statement.apply(this,["halt",docs,location]),this.after=after});module.exports=Halt},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Goto=Statement.extends(function Goto(label,docs,location){Statement.apply(this,["goto",docs,location]),this.label=label});module.exports=Goto},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Global=Statement.extends(function Global(items,docs,location){Statement.apply(this,["global",docs,location]),this.items=items});module.exports=Global},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Foreach=Statement.extends(function Foreach(source,key,value,body,shortForm,docs,location){Statement.apply(this,["foreach",docs,location]),this.source=source,this.key=key,this.value=value,this.shortForm=shortForm,this.body=body});module.exports=Foreach},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),For=Statement.extends(function For(init,test,increment,body,shortForm,docs,location){Statement.apply(this,["for",docs,location]),this.init=init,this.test=test,this.increment=increment,this.shortForm=shortForm,this.body=body});module.exports=For},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Exit=Statement.extends(function Exit(status,useDie,docs,location){Statement.apply(this,["exit",docs,location]),this.status=status,this.useDie=useDie});module.exports=Exit},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Eval=Statement.extends(function Eval(source,docs,location){Statement.apply(this,["eval",docs,location]),this.source=source});module.exports=Eval},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Error=Node.extends(function Error(message,token,line,expected,docs,location){Node.apply(this,["error",docs,location]),this.message=message,this.token=token,this.line=line,this.expected=expected});module.exports=Error},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Entry=Node.extends(function Entry(key,value,docs,location){Node.apply(this,["entry",docs,location]),this.key=key,this.value=value});module.exports=Entry},function(module,exports,__webpack_require__){"use strict";var Literal=__webpack_require__(4),Encapsed=Literal.extends(function Encapsed(value,raw,type,docs,location){Literal.apply(this,["encapsed",value,raw,docs,location]),this.type=type});Encapsed.TYPE_STRING="string",Encapsed.TYPE_SHELL="shell",Encapsed.TYPE_HEREDOC="heredoc",Encapsed.TYPE_OFFSET="offset",module.exports=Encapsed},function(module,exports,__webpack_require__){"use strict";var Sys=__webpack_require__(5),Empty=Sys.extends(function Empty(args,docs,location){Sys.apply(this,["empty",args,docs,location])});module.exports=Empty},function(module,exports,__webpack_require__){"use strict";var Sys=__webpack_require__(5),Echo=Sys.extends(function Echo(args,shortForm,docs,location){Sys.apply(this,["echo",args,docs,location]),this.shortForm=shortForm});module.exports=Echo},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Do=Statement.extends(function Do(test,body,docs,location){Statement.apply(this,["do",docs,location]),this.test=test,this.body=body});module.exports=Do},function(module,exports,__webpack_require__){"use strict";var Block=__webpack_require__(8),Declare=Block.extends(function Declare(what,body,mode,docs,location){Block.apply(this,["declare",body,docs,location]),this.what=what,this.mode=mode});Declare.MODE_SHORT="short",Declare.MODE_BLOCK="block",Declare.MODE_NONE="none",module.exports=Declare},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Continue=Node.extends(function Continue(level,docs,location){Node.apply(this,["continue",docs,location]),this.level=level});module.exports=Continue},function(module,exports,__webpack_require__){"use strict";var Expr=__webpack_require__(2),ConstRef=Expr.extends(function ConstRef(identifier,docs,location){Expr.apply(this,["constref",docs,location]),this.name=identifier});module.exports=ConstRef},function(module,exports,__webpack_require__){"use strict";var Comment=__webpack_require__(9),CommentLine=Comment.extends(function CommentLine(value,docs,location){Comment.apply(this,["commentline",value,docs,location])});module.exports=CommentLine},function(module,exports,__webpack_require__){"use strict";var Comment=__webpack_require__(9),CommentBlock=Comment.extends(function CommentBlock(value,docs,location){Comment.apply(this,["commentblock",value,docs,location])});module.exports=CommentBlock},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Closure=Statement.extends(function Closure(args,byref,uses,type,nullable,isStatic,docs,location){Statement.apply(this,["closure",docs,location]),this.uses=uses,this.arguments=args,this.byref=byref,this.type=type,this.nullable=nullable,this.isStatic=isStatic||!1,this.body=null});module.exports=Closure},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Clone=Statement.extends(function Clone(what,docs,location){Statement.apply(this,["clone",docs,location]),this.what=what});module.exports=Clone},function(module,exports,__webpack_require__){"use strict";var Constant=__webpack_require__(11),ClassConstant=Constant.extends(function ClassConstant(name,value,flags,docs,location){Constant.apply(this,[name,value,docs,location]),this.kind="classconstant",this.parseFlags(flags)});module.exports=ClassConstant},function(module,exports,__webpack_require__){"use strict";var Declaration=__webpack_require__(3),Class=Declaration.extends(function Class(name,ext,impl,body,flags,docs,location){Declaration.apply(this,["class",name,docs,location]),this.isAnonymous=!name,this.extends=ext,this.implements=impl,this.body=body,this.parseFlags(flags)});module.exports=Class},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Catch=Statement.extends(function Catch(body,what,variable,docs,location){Statement.apply(this,["catch",docs,location]),this.body=body,this.what=what,this.variable=variable});module.exports=Catch},function(module,exports,__webpack_require__){"use strict";var Operation=__webpack_require__(6),Cast=Operation.extends(function Cast(type,raw,what,docs,location){Operation.apply(this,["cast",docs,location]),this.type=type,this.raw=raw,this.what=what});module.exports=Cast},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Case=Node.extends(function Case(test,body,docs,location){Node.apply(this,["case",docs,location]),this.test=test,this.body=body});module.exports=Case},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Call=Statement.extends(function Call(what,args,docs,location){Statement.apply(this,["call",docs,location]),this.what=what,this.arguments=args});module.exports=Call},function(module,exports,__webpack_require__){"use strict";var Node=__webpack_require__(1),Break=Node.extends(function Break(level,docs,location){Node.apply(this,["break",docs,location]),this.level=level});module.exports=Break},function(module,exports,__webpack_require__){"use strict";var Literal=__webpack_require__(4),Boolean=Literal.extends(function Boolean(value,raw,docs,location){Literal.apply(this,["boolean",value,raw,docs,location])});module.exports=Boolean},function(module,exports,__webpack_require__){"use strict";var Operation=__webpack_require__(6),Bin=Operation.extends(function Bin(type,left,right,docs,location){Operation.apply(this,["bin",docs,location]),this.type=type,this.left=left,this.right=right});module.exports=Bin},function(module,exports,__webpack_require__){"use strict";var Statement=__webpack_require__(0),Assign=Statement.extends(function Assign(left,right,operator,docs,location){Statement.apply(this,["assign",docs,location]),this.operator=operator,this.left=left,this.right=right});module.exports=Assign},function(module,exports,__webpack_require__){"use strict";var Expr=__webpack_require__(2),Array=Expr.extends(function Array(shortForm,items,docs,location){Expr.apply(this,["array",docs,location]),this.items=items,this.shortForm=shortForm});module.exports=Array},function(module,exports,__webpack_require__){"use strict";module.exports=function Position(line,column,offset){this.line=line,this.column=column,this.offset=offset}},function(module,exports,__webpack_require__){"use strict";module.exports=function Location(source,start,end){this.source=source,this.start=start,this.end=end}},function(module,exports,__webpack_require__){"use strict";var Location=__webpack_require__(88),Position=__webpack_require__(87),AST=function AST(withPositions,withSource){this.withPositions=withPositions,this.withSource=withSource};AST.prototype.position=function(parser){return new Position(parser.lexer.yylloc.first_line,parser.lexer.yylloc.first_column,parser.lexer.yylloc.first_offset)},AST.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"]].forEach(function(list,index){list.forEach(function(operator){AST.precedence[operator]=index+1})}),AST.prototype.resolvePrecedence=function(result){var buffer=void 0,lLevel=void 0,rLevel=void 0;return"bin"===result.kind?result.right&&!result.right.parenthesizedExpression&&("bin"===result.right.kind?(lLevel=AST.precedence[result.type],rLevel=AST.precedence[result.right.type],lLevel&&rLevel&&rLevel<=lLevel&&(buffer=result.right,result.right=result.right.left,buffer.left=this.resolvePrecedence(result),result=buffer)):"retif"===result.right.kind&&(lLevel=AST.precedence[result.type],rLevel=AST.precedence["?"],lLevel&&rLevel&&rLevel<=lLevel&&(buffer=result.right,result.right=result.right.test,buffer.test=this.resolvePrecedence(result),result=buffer))):"unary"===result.kind?result.what&&!result.what.parenthesizedExpression&&("bin"===result.what.kind?(buffer=result.what,result.what=result.what.left,buffer.left=this.resolvePrecedence(result),result=buffer):"retif"===result.what.kind&&(buffer=result.what,result.what=result.what.test,buffer.test=this.resolvePrecedence(result),result=buffer)):"retif"===result.kind?result.falseExpr&&"retif"===result.falseExpr.kind&&!result.falseExpr.parenthesizedExpression&&(buffer=result.falseExpr,result.falseExpr=buffer.test,buffer.test=this.resolvePrecedence(result),result=buffer):"assign"===result.kind&&result.right&&"bin"===result.right.kind&&!result.right.parenthesizedExpression&&(lLevel=AST.precedence["="],rLevel=AST.precedence[result.right.type],lLevel&&rLevel&&rLevel0?body(null,items):null)}}},function(module,exports,__webpack_require__){"use strict";module.exports={read_top_statements:function read_top_statements(){for(var result=[];this.token!==this.EOF&&"}"!==this.token;){var statement=this.read_top_statement();statement&&(Array.isArray(statement)?result=result.concat(statement):result.push(statement))}return result},read_top_statement:function read_top_statement(){switch(this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:var flag=this.read_class_scope();return this.token===this.tok.T_CLASS?this.read_class(flag):(this.error(this.tok.T_CLASS),this.next(),null);case this.tok.T_CLASS:return this.read_class([0,0,0]);case this.tok.T_INTERFACE:return this.read_interface();case this.tok.T_TRAIT:return this.read_trait();case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:return this.next().read_const_list();case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:var result=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,result(this.lexer._input.substring(this.lexer.offset));default:return this.read_statement()}},read_inner_statements:function read_inner_statements(){for(var result=[];this.token!=this.EOF&&"}"!==this.token;){var statement=this.read_inner_statement();statement&&(Array.isArray(statement)?result=result.concat(statement):result.push(statement))}return result},read_const_list:function read_const_list(){var result=this.read_list(function(){this.expect(this.tok.T_STRING);var result=this.node("constant"),name=this.text();return this.next().expect("=")?result(name,this.next().read_expr()):result(name,null)},",",!1);return this.expectEndOfStatement(),result},read_declare_list:function read_declare_list(){for(var result={};this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);var name=this.text().toLowerCase();if(this.next().expect("=")?result[name]=this.next().read_expr():result[name]=null,","!==this.token)break;this.next()}return result},read_inner_statement:function read_inner_statement(){switch(this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:var flag=this.read_class_scope();return this.token===this.tok.T_CLASS?this.read_class(flag):(this.error(this.tok.T_CLASS),this.next(),null);case this.tok.T_CLASS:return this.read_class([0,0,0]);case this.tok.T_INTERFACE:return this.read_interface();case this.tok.T_TRAIT:return this.read_trait();case this.tok.T_HALT_COMPILER:this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");var node=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),node=node(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),node;default:return this.read_statement()}},read_statement:function read_statement(){var result=void 0,expr=void 0,items=void 0,current=void 0,label=void 0;switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.next().read_for();case this.tok.T_FOREACH:return this.next().read_foreach();case this.tok.T_WHILE:return this.next().read_while();case this.tok.T_DO:return this.next().read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:return result=this.node("return"),expr=null,this.next().is("EOS")||(expr=this.read_expr()),this.expectEndOfStatement(),result(expr);case this.tok.T_BREAK:case this.tok.T_CONTINUE:result=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");var level=null;return this.next(),";"!==this.token&&(level=this.read_expr()),this.expectEndOfStatement(),result(level);case this.tok.T_GLOBAL:return result=this.node("global"),items=this.next().read_list(this.read_simple_variable,","),this.expectEndOfStatement(),result(items);case this.tok.T_STATIC:return current=[this.token,this.lexer.getState()],result=this.node("static"),this.next().token===this.tok.T_DOUBLE_COLON?(this.lexer.tokens.push(current),expr=this.next().read_expr(),this.expect(";")&&this.next(),expr):this.token===this.tok.T_FUNCTION?this.read_function(!0,[0,1,0]):(items=this.read_variable_declarations(),this.expectEndOfStatement(),result(items));case this.tok.T_ECHO:result=this.node("echo");var text=this.text(),shortForm="0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null,fixFirstLine="\r"===prevChar||"\n"===prevChar;return fixFirstLine&&"\n"===prevChar&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(prevChar="\r\n"),result=this.node("inline"),this.next(),result(value,fixFirstLine?prevChar+value:value);case this.tok.T_UNSET:return result=this.node("unset"),this.next().expect("(")&&this.next(),items=this.read_list(this.read_variable,","),this.expect(")")&&this.next(),this.expect(";")&&this.next(),result(items);case this.tok.T_DECLARE:result=this.node("declare");var body=[],mode=void 0;this.next().expect("(")&&this.next();var what=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)body.push(this.read_top_statement());this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),mode=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)body.push(this.read_top_statement());this.expect("}")&&this.next(),mode=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),mode=this.ast.declare.MODE_NONE;return result(what,body,mode);case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:return result=this.node("throw"),expr=this.next().read_expr(),this.expectEndOfStatement(),result(expr);case";":return this.next(),null;case this.tok.T_STRING:return current=[this.token,this.lexer.getState()],label=this.text(),":"===this.next().token?(result=this.node("label"),this.next(),result(label)):(this.lexer.tokens.push(current),expr=this.next().read_expr(),this.expectEndOfStatement(),expr);case this.tok.T_GOTO:return result=this.node("goto"),label=null,this.next().expect(this.tok.T_STRING)&&(label=this.text(),this.next().expectEndOfStatement()),result(label);default:return expr=this.read_expr(),this.expectEndOfStatement(expr),expr}},read_code_block:function read_code_block(top){var result=this.node("block");this.expect("{")&&this.next();var body=top?this.read_top_statements():this.read_inner_statements();return this.expect("}")&&this.next(),result(null,body)}}},function(module,exports,__webpack_require__){"use strict";var specialChar={"\\r":"\r","\\n":"\n","\\t":"\t","\\v":String.fromCharCode(11),"\\e":String.fromCharCode(27),"\\f":String.fromCharCode(12),"\\\\":"\\","\\$":"$",'\\"':'"',"\\'":"'"};module.exports={resolve_special_chars:function resolve_special_chars(text,doubleQuote){return doubleQuote?text.replace(/\\[rntvef"'\\$]/g,function(seq){return specialChar[seq]}):text.replace(/\\['\\]/g,function(seq){return specialChar[seq]})},read_scalar:function read_scalar(){if(this.is("T_MAGIC_CONST"))return this.get_magic_constant();var value=void 0,node=void 0;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:value=this.node("string");var text=this.text(),offset=0;"b"!==text[0]&&"B"!==text[0]||(offset=1);var isDoubleQuote='"'===text[offset];return this.next(),value=value(isDoubleQuote,this.resolve_special_chars(text.substring(offset+1,text.length-1),isDoubleQuote),1===offset,text),this.token===this.tok.T_DOUBLE_COLON?this.read_static_getter(value):value;case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){var start=this.lexer.yylloc.first_offset;node=this.node("nowdoc");var lastCh=(value=this.next().text())[value.length-1];"\n"===lastCh?value="\r"===value[value.length-2]?value.substring(0,value.length-2):value.substring(0,value.length-1):"\r"===lastCh&&(value=value.substring(0,value.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next();var raw=this.lexer._input.substring(start,this.lexer.yylloc.last_offset);return node=node(value,raw,this.lexer.heredoc_label,'"'===raw[3]||"'"===raw[3]),this.expect(this.tok.T_END_HEREDOC)&&this.next(),node}return this.next().read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.next().read_encapsed_string('"');case'b"':case'B"':return this.next(),this.lexer.yylloc.prev_offset-=1,this.read_encapsed_string('"');case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:var result=this.node("number");return value=this.text(),this.next(),result(value,null);case this.tok.T_ARRAY:case"[":return this.read_array();default:var err=this.error("SCALAR");return this.next(),err}},read_dereferencable:function read_dereferencable(expr){var result=void 0,offset=void 0,node=this.node("offsetlookup");return"["===this.token?(offset=this.next().read_expr(),this.expect("]")&&this.next(),result=node(expr,offset)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(result=node(expr,offset=this.read_encapsed_string_item(!1))),result},read_encapsed_string_item:function read_encapsed_string_item(isDoubleQuote){var result=this.node(),offset=void 0,node=void 0,name=void 0;if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){var text=this.text();this.next(),result=result("string",!1,this.resolve_special_chars(text,isDoubleQuote),!1,text)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){if(name=null,this.next().token===this.tok.T_STRING_VARNAME){var varName=this.text();name=this.node("variable"),this.next(),"["===this.token?(name=name(varName,!1),node=this.node("offsetlookup"),offset=this.next().read_expr(),this.expect("]")&&this.next(),name=node(name,offset)):name=this.node("constref")(varName)}else name=this.read_expr();this.expect("}")&&this.next(),result=result("variable",name,!1,!0)}else if(this.token===this.tok.T_CURLY_OPEN)"variable"===(result=this.next().read_variable(!1,!1,!1)).kind&&(result.curly=!0),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(result=this.read_simple_variable(!1),"["===this.token&&(node=this.node("offsetlookup"),offset=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),result=node(result,offset)),this.token===this.tok.T_OBJECT_OPERATOR){node=this.node("propertylookup");var what=this.node("constref");this.next().expect(this.tok.T_STRING),name=this.text(),this.next(),result=node(result,what(name))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);var value=this.text();this.next(),result=result("string",!1,value,!1,value)}return result},read_encapsed_string:function read_encapsed_string(expect){var start=this.lexer.yylloc.prev_offset,node=this.node("encapsed"),value=[],type=null;for(type="`"===expect?this.ast.encapsed.TYPE_SHELL:'"'===expect?this.ast.encapsed.TYPE_STRING:this.ast.encapsed.TYPE_HEREDOC;this.token!==expect&&this.token!==this.EOF;)value.push(this.read_encapsed_string_item(!0));return this.expect(expect)&&this.next(),node=node(value,this.lexer._input.substring(start-1,this.lexer.yylloc.first_offset),type),expect===this.tok.T_END_HEREDOC&&(node.label=this.lexer.heredoc_label),node},get_magic_constant:function get_magic_constant(){var result=this.node("magic"),name=this.text();return this.next(),result(name.toUpperCase(),name)}}},function(module,exports,__webpack_require__){"use strict";module.exports={read_namespace:function read_namespace(){var result=this.node("namespace"),body=void 0;if(this.expect(this.tok.T_NAMESPACE)&&this.next(),"{"==this.token)return this.currentNamespace=[""],body=this.next().read_top_statements(),this.expect("}")&&this.next(),result([""],body,!0);var name=this.read_namespace_name();return";"==this.token?(this.currentNamespace=name,body=this.next().read_top_statements(),this.expect(this.EOF),result(name.name,body,!1)):"{"==this.token?(this.currentNamespace=name,body=this.next().read_top_statements(),this.expect("}")&&this.next(),result(name.name,body,!0)):"("===this.token?(name.resolution=this.ast.identifier.RELATIVE_NAME,name.name=name.name.substring(1),this.node("call")(name,this.read_function_argument_list())):(this.error(["{",";"]),this.currentNamespace=name,body=this.read_top_statements(),this.expect(this.EOF),result(name,body,!1))},read_namespace_name:function read_namespace_name(){var result=this.node("identifier"),relative=!1;return this.token===this.tok.T_NAMESPACE&&(this.next().expect(this.tok.T_NS_SEPARATOR)&&this.next(),relative=!0),result(this.read_list(this.tok.T_STRING,this.tok.T_NS_SEPARATOR,!0),relative)},read_use_statement:function read_use_statement(){var result=this.node("usegroup"),items=[],name=null;this.expect(this.tok.T_USE)&&this.next();var type=this.read_use_type();return items.push(this.read_use_declaration(!1)),","===this.token?items=items.concat(this.next().read_use_declarations(!1)):"{"===this.token&&(name=items[0].name,items=this.next().read_use_declarations(null===type),this.expect("}")&&this.next()),result=result(name,type,items),this.expect(";")&&this.next(),result},read_use_declaration:function read_use_declaration(typed){var result=this.node("useitem"),type=null;typed&&(type=this.read_use_type());var name=this.read_namespace_name(),alias=this.read_use_alias();return result(name.name,alias,type)},read_use_declarations:function read_use_declarations(typed){for(var result=[this.read_use_declaration(typed)];","===this.token;)result.push(this.next().read_use_declaration(typed));return result},read_use_alias:function read_use_alias(){var result=null;return this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)&&(result=this.text(),this.next()),result},read_use_type:function read_use_type(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}}},function(module,exports,__webpack_require__){"use strict";module.exports={read_start:function read_start(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}}},function(module,exports,__webpack_require__){"use strict";module.exports={read_while:function read_while(){var test,result=this.node("while"),body=null,shortForm=!1;return this.expect("(")&&this.next(),test=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(shortForm=!0,body=this.read_short_form(this.tok.T_ENDWHILE)):body=this.read_statement(),result(test,body,shortForm)},read_do:function read_do(){var body,result=this.node("do"),test=null;return body=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),test=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),result(test,body)},read_for:function read_for(){var result=this.node("for"),init=[],test=[],increment=[],body=null,shortForm=!1;return this.expect("(")&&this.next(),";"!==this.token?(init=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),";"!==this.token?(test=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),")"!==this.token?(increment=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(shortForm=!0,body=this.read_short_form(this.tok.T_ENDFOR)):body=this.read_statement(),result(init,test,increment,body,shortForm)},read_foreach:function read_foreach(){var source,result=this.node("foreach"),key=null,value=null,body=null,shortForm=!1;return this.expect("(")&&this.next(),source=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),value=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(key=value,value=this.next().read_foreach_variable())),key&&"list"===key.kind&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),":"===this.token?(shortForm=!0,body=this.read_short_form(this.tok.T_ENDFOREACH)):body=this.read_statement(),result(source,key,value,body,shortForm)},read_foreach_variable:function read_foreach_variable(){if(this.token===this.tok.T_LIST||"["===this.token){var isShort="["===this.token,result=this.node("list");this.next(),!isShort&&this.expect("(")&&this.next();var assignList=this.read_array_pair_list(isShort);return this.expect(isShort?"]":")")&&this.next(),result(assignList,isShort)}return this.read_variable(!1,!1,!1)}}},function(module,exports,__webpack_require__){"use strict";module.exports={read_if:function read_if(){var test,result=this.node("if"),body=null,alternate=null,shortForm=!1;if(test=this.next().read_if_expr(),":"===this.token){shortForm=!0,this.next(),body=this.node("block");for(var items=[];this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){alternate=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){alternate=this.read_else_short();break}items.push(this.read_inner_statement())}body=body(null,items),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else body=this.read_statement(),this.token===this.tok.T_ELSEIF?alternate=this.read_if():this.token===this.tok.T_ELSE&&(alternate=this.next().read_statement());return result(test,body,alternate,shortForm)},read_if_expr:function read_if_expr(){this.expect("(")&&this.next();var result=this.read_expr();return this.expect(")")&&this.next(),result},read_elseif_short:function read_elseif_short(){var test,result=this.node("if"),alternate=null,body=null,items=[];for(test=this.next().read_if_expr(),this.expect(":")&&this.next(),body=this.node("block");this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){alternate=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){alternate=this.read_else_short();break}items.push(this.read_inner_statement())}return result(test,body=body(null,items),alternate,!0)},read_else_short:function read_else_short(){var body=this.node("block");this.next().expect(":")&&this.next();for(var items=[];this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)items.push(this.read_inner_statement());return body(null,items)}}},function(module,exports,__webpack_require__){"use strict";module.exports={is_reference:function is_reference(){return"&"==this.token&&(this.next(),!0)},is_variadic:function is_variadic(){return this.token===this.tok.T_ELLIPSIS&&(this.next(),!0)},read_function:function read_function(closure,flag){var result=this.read_function_declaration(closure?1:flag?2:0,flag&&1===flag[1]);return flag&&1==flag[2]?(result.parseFlags(flag),this.expect(";")&&this.next()):(this.expect("{")&&(result.body=this.read_code_block(!1),result.loc&&result.body.loc&&(result.loc.end=result.body.loc.end)),!closure&&flag&&result.parseFlags(flag)),result},read_function_declaration:function read_function_declaration(type,isStatic){var nodeName="function";1===type?nodeName="closure":2===type&&(nodeName="method");var result=this.node(nodeName);this.expect(this.tok.T_FUNCTION)&&this.next();var isRef=this.is_reference(),name=!1,use=[],returnType=null,nullable=!1;1!==type&&(2===type?this.token===this.tok.T_STRING||this.php7&&this.is("IDENTIFIER")?(name=this.text(),this.next()):this.error("IDENTIFIER"):(this.expect(this.tok.T_STRING)&&(name=this.text()),this.next())),this.expect("(")&&this.next();var params=this.read_parameter_list();return this.expect(")")&&this.next(),1===type&&this.token===this.tok.T_USE&&(this.next().expect("(")&&this.next(),use=this.read_list(this.read_lexical_var,","),this.expect(")")&&this.next()),":"===this.token&&("?"===this.next().token&&(nullable=!0,this.next()),returnType=this.read_type()),1===type?result(params,isRef,use,returnType,nullable,isStatic):result(name,params,isRef,returnType,nullable)},read_lexical_var:function read_lexical_var(){var result=this.node("variable"),isRef=!1;"&"===this.token&&(isRef=!0,this.next()),this.expect(this.tok.T_VARIABLE);var name=this.text().substring(1);return this.next(),result(name,isRef,!1)},read_parameter_list:function read_parameter_list(){var result=[];if(")"!=this.token)for(;this.token!=this.EOF;){if(result.push(this.read_parameter()),","!=this.token){if(")"==this.token)break;this.error([",",")"]);break}this.next()}return result},read_parameter:function read_parameter(){var type,node=this.node("parameter"),name=null,value=null,nullable=!1;"?"===this.token&&(this.next(),nullable=!0),type=this.read_type(),nullable&&!type&&this.raiseError("Expecting a type definition combined with nullable operator");var isRef=this.is_reference(),isVariadic=this.is_variadic();return this.expect(this.tok.T_VARIABLE)&&(name=this.text().substring(1),this.next()),"="==this.token&&(value=this.next().read_expr()),node(name,type,value,isRef,isVariadic,nullable)},read_function_argument_list:function read_function_argument_list(){var result=[],wasVariadic=!1;if(this.expect("(")&&this.next(),")"!==this.token)for(;this.token!=this.EOF;){var argument=this.read_argument_list();if(argument&&(result.push(argument),"variadic"===argument.kind?wasVariadic=!0:wasVariadic&&this.raiseError("Unexpected argument after a variadic argument")),","!==this.token)break;this.next()}return this.expect(")")&&this.next(),result},read_argument_list:function read_argument_list(){return this.token===this.tok.T_ELLIPSIS?this.node("variadic")(this.next().read_expr()):this.read_expr()},read_type:function read_type(){var result=this.node("identifier");switch(this.token){case this.tok.T_ARRAY:return this.next(),result(["","array"],!1);case this.tok.T_NAMESPACE:case this.tok.T_NS_SEPARATOR:case this.tok.T_STRING:return this.read_namespace_name();case this.tok.T_CALLABLE:return this.next(),result(["","callable"],!1);default:return null}}}},function(module,exports,__webpack_require__){"use strict";module.exports={read_expr:function read_expr(){var result=this.node(),expr=this.read_expr_item();if("|"===this.token)return result("bin","|",expr,this.next().read_expr());if("&"===this.token)return result("bin","&",expr,this.next().read_expr());if("^"===this.token)return result("bin","^",expr,this.next().read_expr());if("."===this.token)return result("bin",".",expr,this.next().read_expr());if("+"===this.token)return result("bin","+",expr,this.next().read_expr());if("-"===this.token)return result("bin","-",expr,this.next().read_expr());if("*"===this.token)return result("bin","*",expr,this.next().read_expr());if("/"===this.token)return result("bin","/",expr,this.next().read_expr());if("%"===this.token)return result("bin","%",expr,this.next().read_expr());if(this.token===this.tok.T_POW)return result("bin","**",expr,this.next().read_expr());if(this.token===this.tok.T_SL)return result("bin","<<",expr,this.next().read_expr());if(this.token===this.tok.T_SR)return result("bin",">>",expr,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return result("bin","||",expr,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return result("bin","or",expr,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return result("bin","&&",expr,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return result("bin","and",expr,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return result("bin","xor",expr,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return result("bin","===",expr,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return result("bin","!==",expr,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return result("bin","==",expr,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_EQUAL)return result("bin","!=",expr,this.next().read_expr());if("<"===this.token)return result("bin","<",expr,this.next().read_expr());if(">"===this.token)return result("bin",">",expr,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return result("bin","<=",expr,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return result("bin",">=",expr,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return result("bin","<=>",expr,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF)return result("bin","instanceof",expr,this.next().read_expr());if(this.token===this.tok.T_COALESCE)return result("bin","??",expr,this.next().read_expr());if("?"===this.token){var trueArg=null;return":"!==this.next().token&&(trueArg=this.read_expr()),this.expect(":")&&this.next(),result("retif",expr,trueArg,this.read_expr())}return expr},read_expr_item:function read_expr_item(){var result=void 0,expr=void 0;if("@"===this.token)return this.node("silent")(this.next().read_expr());if("+"===this.token)return this.node("unary")("+",this.next().read_expr());if("!"===this.token)return this.node("unary")("!",this.next().read_expr());if("~"===this.token)return this.node("unary")("~",this.next().read_expr());if("-"===this.token)return result=this.node(),this.next(),this.token===this.tok.T_LNUMBER||this.token===this.tok.T_DNUMBER?(result=result("number","-"+this.text(),null),this.next(),result):result("unary","-",this.read_expr());if("("===this.token)return(expr=this.next().read_expr()).parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(expr);if("`"===this.token)return this.next().read_encapsed_string("`");if(this.token===this.tok.T_LIST){var assign=null,isInner=this.innerList;result=this.node("list"),isInner||(assign=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);var assignList=this.read_array_pair_list(!1);this.expect(")")&&this.next();for(var hasItem=!1,i=0;i>=");case this.tok.T_INC:return isConst&&this.error("VARIABLE"),this.next(),result("post","+",expr);case this.tok.T_DEC:return isConst&&this.error("VARIABLE"),this.next(),result("post","-",expr)}}else{if(this.is("SCALAR")){if(result=this.node(),"array"===(expr=this.read_scalar()).kind&&expr.shortForm&&"="===this.token){var list=this.node("list")(expr.items,!0);return expr.loc&&(list.loc=expr.loc),result("assign",list,this.next().read_expr(),"=")}return this.handleDereferencable(expr)}this.error("EXPR"),this.next()}return expr},read_new_expr:function read_new_expr(){var result=this.node("new"),args=[];if(this.token===this.tok.T_CLASS){var what=this.node("class"),propExtends=null,propImplements=null,body=null;return"("===this.next().token&&(args=this.read_function_argument_list()),this.token==this.tok.T_EXTENDS&&(propExtends=this.next().read_namespace_name()),this.token==this.tok.T_IMPLEMENTS&&(propImplements=this.next().read_name_list()),this.expect("{")&&(body=this.next().read_class_body()),result(what(null,propExtends,propImplements,body,[0,0,0]),args)}var name=this.read_class_name_reference();return"("===this.token&&(args=this.read_function_argument_list()),result(name,args)},read_class_name_reference:function read_class_name_reference(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){var result=this.read_namespace_name();return this.token===this.tok.T_DOUBLE_COLON&&(result=this.read_static_getter(result)),result}if(this.is("VARIABLE"))return this.read_variable(!0,!1,!1);this.expect([this.tok.T_STRING,"VARIABLE"])},handleDereferencable:function handleDereferencable(expr){for(;this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR)expr=this.recursive_variable_chain_scan(expr,!1);else if(this.token===this.tok.T_CURLY_OPEN||"["===this.token)expr=this.read_dereferencable(expr);else{if("("!==this.token)return expr;expr=this.node("call")(expr,this.read_function_argument_list())}return expr}}},function(module,exports,__webpack_require__){"use strict";module.exports={read_comment:function read_comment(){var text=this.text(),result=this.ast.prepare("/*"===text.substring(0,2)?"commentblock":"commentline",null,this),prev=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),result=result(text),this.prev=prev,result},read_doc_comment:function read_doc_comment(){var result=this.ast.prepare("commentblock",null,this),text=this.text(),prev=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),result=result(text),this.prev=prev,result}}},function(module,exports,__webpack_require__){"use strict";module.exports={read_class:function read_class(flag){var result=this.node("class");this.expect(this.tok.T_CLASS),this.next().expect(this.tok.T_STRING);var propName=this.text(),propExtends=null,propImplements=null;return this.next().token==this.tok.T_EXTENDS&&(propExtends=this.next().read_namespace_name()),this.token==this.tok.T_IMPLEMENTS&&(propImplements=this.next().read_name_list()),this.expect("{"),result(propName,propExtends,propImplements,this.next().read_class_body(),flag)},read_class_scope:function read_class_scope(){var result=this.token;return result==this.tok.T_FINAL?(this.next(),[0,0,2]):result==this.tok.T_ABSTRACT?(this.next(),[0,0,1]):[0,0,0]},read_class_body:function read_class_body(){for(var result=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT)if(this.token!==this.tok.T_USE){var flags=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),flags[0]=flags[1]=0),this.token===this.tok.T_VARIABLE){var variables=this.read_variable_list(flags);this.expect(";"),this.next(),result=result.concat(variables)}else this.token===this.tok.T_FUNCTION?result.push(this.read_function(!1,flags)):(this.error([this.tok.T_CONST,this.tok.T_VARIABLE,this.tok.T_FUNCTION]),this.next());else{var constants=this.read_constant_list(flags);this.expect(";")&&this.next(),result=result.concat(constants)}}else result=result.concat(this.next().read_trait_use_statement());else result.push(this.read_doc_comment());else result.push(this.read_comment());return this.expect("}"),this.next(),result},read_variable_list:function read_variable_list(flags){return this.read_list(function read_variable_declaration(){var result=this.node("property");this.expect(this.tok.T_VARIABLE);var name=this.text().substring(1);return this.next(),";"===this.token||","===this.token?result(name,null,flags):"="===this.token?result(name,this.next().read_expr(),flags):(this.expect([",",";","="]),result(name,null,flags))},",")},read_constant_list:function read_constant_list(flags){return this.expect(this.tok.T_CONST)&&this.next(),this.read_list(function read_constant_declaration(){var result=this.node("classconstant"),name=null,value=null;return this.token===this.tok.T_STRING||this.php7&&this.is("IDENTIFIER")?(name=this.text(),this.next()):this.expect("IDENTIFIER"),this.expect("=")&&(value=this.next().read_expr()),result(name,value,flags)},",")},read_member_flags:function read_member_flags(asInterface){var result=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){var idx=0,val=0;do{switch(this.token){case this.tok.T_PUBLIC:idx=0,val=0;break;case this.tok.T_PROTECTED:idx=0,val=1;break;case this.tok.T_PRIVATE:idx=0,val=2;break;case this.tok.T_STATIC:idx=1,val=1;break;case this.tok.T_ABSTRACT:idx=2,val=1;break;case this.tok.T_FINAL:idx=2,val=2}asInterface&&(0==idx&&2==val?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),val=-1):2==idx&&1==val&&(this.error(),val=-1)),-1!==result[idx]?this.error():-1!==val&&(result[idx]=val)}while(this.next().is("T_MEMBER_FLAGS"))}return-1==result[1]&&(result[1]=0),-1==result[2]&&(result[2]=0),result},read_interface:function read_interface(){var result=this.node("interface"),name=null,body=null,propExtends=null;return this.expect(this.tok.T_INTERFACE)&&this.next(),this.expect(this.tok.T_STRING)&&(name=this.text(),this.next()),this.token===this.tok.T_EXTENDS&&(propExtends=this.next().read_name_list()),this.expect("{")&&(body=this.next().read_interface_body()),result(name,propExtends,body)},read_interface_body:function read_interface_body(){for(var result=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT){var flags=this.read_member_flags(!0);if(this.token==this.tok.T_CONST){var constants=this.read_constant_list(flags);this.expect(";")&&this.next(),result=result.concat(constants)}else if(this.token===this.tok.T_FUNCTION){var method=this.read_function_declaration(2,flags);method.parseFlags(flags),result.push(method),this.expect(";")&&this.next()}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}else result.push(this.read_doc_comment());else result.push(this.read_comment());return this.expect("}")&&this.next(),result},read_trait:function read_trait(){var result=this.node("trait"),propName=null,propExtends=null,propImplements=null,body=null;return this.expect(this.tok.T_TRAIT)&&this.next(),this.expect(this.tok.T_STRING)&&(propName=this.text()),this.next().token==this.tok.T_EXTENDS&&(propExtends=this.next().read_namespace_name()),this.token==this.tok.T_IMPLEMENTS&&(propImplements=this.next().read_name_list()),this.expect("{")&&(body=this.next().read_class_body()),result(propName,propExtends,propImplements,body)},read_trait_use_statement:function read_trait_use_statement(){for(var node=this.node("traituse"),traits=[this.read_namespace_name()],adaptations=null;","===this.token;)traits.push(this.next().read_namespace_name());if("{"===this.token){for(adaptations=[];this.next().token!==this.EOF&&"}"!==this.token;)adaptations.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return node(traits,adaptations)},read_trait_use_alias:function read_trait_use_alias(){var node=this.node(),trait=null,method=void 0;if(this.is("IDENTIFIER")?(method=this.text(),this.next()):(method=this.read_namespace_name(),this.token===this.tok.T_DOUBLE_COLON?(this.next(),this.token===this.tok.T_STRING||this.php7&&this.is("IDENTIFIER")?(trait=method,method=this.text(),this.next()):this.expect(this.tok.T_STRING)):method=method.name),this.token===this.tok.T_INSTEADOF)return node("traitprecedence",trait,method,this.next().read_name_list());if(this.token===this.tok.T_AS){var flags=null,alias=null;return this.next().is("T_MEMBER_FLAGS")&&(flags=this.read_member_flags()),this.token===this.tok.T_STRING||this.php7&&this.is("IDENTIFIER")?(alias=this.text(),this.next()):!1===flags&&this.expect(this.tok.T_STRING),node("traitalias",trait,method,alias,flags)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),node("traitalias",trait,method,null,null)}}},function(module,exports,__webpack_require__){"use strict";module.exports={read_array:function read_array(){var expect=null,shortForm=!1,result=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),expect=")"):(shortForm=!0,expect="]");var items=[];return this.next().token!==expect&&(items=this.read_array_pair_list(shortForm)),this.expect(expect),this.next(),result(shortForm,items)},read_array_pair_list:function read_array_pair_list(shortForm){var self=this;return this.read_list(function(){return self.read_array_pair(shortForm)},",",!0)},read_array_pair:function read_array_pair(shortForm){if(","===this.token||!shortForm&&")"===this.token||shortForm&&"]"===this.token)return null;if("&"===this.token)return this.next().read_variable(!0,!1,!0);var entry=this.node("entry"),expr=this.read_expr();return this.token===this.tok.T_DOUBLE_ARROW?"&"===this.next().token?entry(expr,this.next().read_variable(!0,!1,!0)):entry(expr,this.read_expr()):expr},read_dim_offset:function read_dim_offset(){return"]"!=this.token&&this.read_expr()}}},function(module,exports,__webpack_require__){"use strict";function isNumber(n){return"."!=n&&","!=n&&!isNaN(parseFloat(n))&&isFinite(n)}var parser=function parser(lexer,ast){this.lexer=lexer,this.ast=ast,this.tok=lexer.tok,this.EOF=lexer.EOF,this.token=null,this.prev=null,this.debug=!1,this.php7=!0,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;var mapIt=function mapIt(item){return[item,null]};this.entries={IDENTIFIER:new Map([this.tok.T_ABSTRACT,this.tok.T_ARRAY,this.tok.T_AS,this.tok.T_BREAK,this.tok.T_CALLABLE,this.tok.T_CASE,this.tok.T_CATCH,this.tok.T_CLASS,this.tok.T_CLASS_C,this.tok.T_CLONE,this.tok.T_CONST,this.tok.T_CONTINUE,this.tok.T_DECLARE,this.tok.T_DEFAULT,this.tok.T_DIR,this.tok.T_DO,this.tok.T_ECHO,this.tok.T_ELSE,this.tok.T_ELSEIF,this.tok.T_EMPTY,this.tok.T_ENDDECLARE,this.tok.T_ENDFOR,this.tok.T_ENDFOREACH,this.tok.T_ENDIF,this.tok.T_ENDSWITCH,this.tok.T_ENDWHILE,this.tok.T_EVAL,this.tok.T_EXIT,this.tok.T_EXTENDS,this.tok.T_FILE,this.tok.T_FINAL,this.tok.T_FINALLY,this.tok.T_FUNC_C,this.tok.T_FOR,this.tok.T_FOREACH,this.tok.T_FUNCTION,this.tok.T_GLOBAL,this.tok.T_GOTO,this.tok.T_IF,this.tok.T_IMPLEMENTS,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_INSTANCEOF,this.tok.T_INSTEADOF,this.tok.T_INTERFACE,this.tok.T_ISSET,this.tok.T_LINE,this.tok.T_LIST,this.tok.T_LOGICAL_AND,this.tok.T_LOGICAL_OR,this.tok.T_LOGICAL_XOR,this.tok.T_METHOD_C,this.tok.T_NAMESPACE,this.tok.T_NEW,this.tok.T_NS_C,this.tok.T_PRINT,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_PUBLIC,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_RETURN,this.tok.T_STATIC,this.tok.T_SWITCH,this.tok.T_THROW,this.tok.T_TRAIT,this.tok.T_TRY,this.tok.T_UNSET,this.tok.T_USE,this.tok.T_VAR,this.tok.T_WHILE,this.tok.T_YIELD].map(mapIt)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(mapIt)),SCALAR:new Map([this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(mapIt)),T_MAGIC_CONST:new Map([this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(mapIt)),T_MEMBER_FLAGS:new Map([this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL].map(mapIt)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(mapIt)),EXPR:new Map(["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(mapIt))}};parser.prototype.getTokenName=function(token){return isNumber(token)?token==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[token]:"'"+token+"'"},parser.prototype.parse=function(code,filename){this._errors=[],this.filename=filename||"eval",this.currentNamespace=[""],this.extractDoc?this._docs=[]:this._docs=null,this.extractTokens?this._tokens=[]:this._tokens=null,this._docIndex=0,this.lexer.setInput(code),this.lexer.all_tokens=this.extractTokens,this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1,this.innerListForm=!1;var program=this.ast.prepare("program",null,this),childs=[];for(this.next();this.token!=this.EOF;){var node=this.read_start();null!==node&&void 0!==node&&(Array.isArray(node)?childs=childs.concat(node):childs.push(node))}return program(childs,this._errors,this._docs,this._tokens)},parser.prototype.raiseError=function(message,msgExpect,expect,token){if(message+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){var err=new SyntaxError(message,this.filename,this.lexer.yylloc.first_line);throw err.lineNumber=this.lexer.yylloc.first_line,err.fileName=this.filename,err.columnNumber=this.lexer.yylloc.first_column,err}var node=this.ast.prepare("error",null,this)(message,token,this.lexer.yylloc.first_line,expect);return this._errors.push(node),node},parser.prototype.error=function(expect){var msg="Parse Error : syntax error",token=this.getTokenName(this.token),msgExpect="";if(this.token!==this.EOF){if(isNumber(this.token)){var symbol=this.text();symbol.length>10&&(symbol=symbol.substring(0,7)+"..."),token="'"+symbol+"' ("+token+")"}msg+=", unexpected "+token}return expect&&!Array.isArray(expect)&&((isNumber(expect)||1===expect.length)&&(msgExpect=", expecting "+this.getTokenName(expect)),msg+=msgExpect),this.raiseError(msg,msgExpect,expect,token)},parser.prototype.node=function(name){if(this.extractDoc&&this._docIndex"+this.lexer.yytext+"< @--\x3e"+line),this},parser.prototype.expect=function(token){if(Array.isArray(token)){if(-1===token.indexOf(this.token))return this.error(token),!1}else if(this.token!=token)return this.error(token),!1;return!0},parser.prototype.text=function(){return this.lexer.yytext},parser.prototype.next=function(){if(";"===this.token&&";"!==this.lexer.yytext||(this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset]),this.lex(),this.debug&&this.showlog(),this.extractDoc)for(;this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.token===this.tok.T_COMMENT?this._docs.push(this.read_comment()):this._docs.push(this.read_doc_comment());return this},parser.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;var entry=this.lexer.yytext;if(entry=this.lexer.engine.tokens.values.hasOwnProperty(this.token)?[this.lexer.engine.tokens.values[this.token],entry,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset]:[null,entry,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset],this._tokens.push(entry),this.token===this.tok.T_CLOSE_TAG)return this.token=";",this;if(this.token===this.tok.T_OPEN_TAG_WITH_ECHO)return this.token=this.tok.T_ECHO,this}while(this.token===this.tok.T_WHITESPACE||!this.extractDoc&&(this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT)||this.token===this.tok.T_OPEN_TAG);else this.token=this.lexer.lex()||this.EOF;return this},parser.prototype.is=function(type){return Array.isArray(type)?-1!==type.indexOf(this.token):this.entries[type].has(this.token)},[__webpack_require__(105),__webpack_require__(104),__webpack_require__(103),__webpack_require__(102),__webpack_require__(101),__webpack_require__(100),__webpack_require__(99),__webpack_require__(98),__webpack_require__(97),__webpack_require__(96),__webpack_require__(95),__webpack_require__(94),__webpack_require__(93),__webpack_require__(92),__webpack_require__(91)].forEach(function(ext){for(var k in ext)parser.prototype[k]=ext[k]}),module.exports=parser},function(module,exports,__webpack_require__){"use strict";module.exports={is_NUM:function is_NUM(){var ch=this._input.charCodeAt(this.offset-1);return ch>47&&ch<58},is_LABEL:function is_LABEL(){var ch=this._input.charCodeAt(this.offset-1);return ch>96&&ch<123||ch>64&&ch<91||95===ch||ch>47&&ch<58||ch>126},is_LABEL_START:function is_LABEL_START(){var ch=this._input.charCodeAt(this.offset-1);return ch>96&&ch<123||ch>64&&ch<91||95===ch||ch>126},consume_LABEL:function consume_LABEL(){for(;this.offset?@".indexOf(ch)},is_WHITESPACE:function is_WHITESPACE(){var ch=this._input[this.offset-1];return" "===ch||"\t"===ch||"\n"===ch||"\r"===ch},is_TABSPACE:function is_TABSPACE(){var ch=this._input[this.offset-1];return" "===ch||"\t"===ch},consume_TABSPACE:function consume_TABSPACE(){for(;this.offset47&&ch<58||ch>64&&ch<71||ch>96&&ch<103}}},function(module,exports,__webpack_require__){"use strict";module.exports={T_STRING:function T_STRING(){var token=this.yytext.toLowerCase(),id=this.keywords[token];if("number"!=typeof id)if("yield"===token)this.php7&&this.tryMatch(" from")?(this.consume(5),id=this.tok.T_YIELD_FROM):id=this.tok.T_YIELD;else if(id=this.tok.T_STRING,"b"===token||"B"===token){var ch=this.input(1);if('"'===ch)return this.ST_DOUBLE_QUOTES();if("'"===ch)return this.T_CONSTANT_ENCAPSED_STRING();ch&&this.unput(1)}return id},consume_TOKEN:function consume_TOKEN(){var ch=this._input[this.offset-1],fn=this.tokenTerminals[ch];return fn?fn.apply(this,[]):this.yytext},tokenTerminals:{$:function $(){return this.offset++,this.is_LABEL_START()?(this.offset--,this.consume_LABEL(),this.tok.T_VARIABLE):(this.offset--,"$")},"-":function _(){var nchar=this._input[this.offset];return">"===nchar?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):"-"===nchar?(this.input(),this.tok.T_DEC):"="===nchar?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\":function _(){return this.tok.T_NS_SEPARATOR},"/":function _(){return"="===this._input[this.offset]?(this.input(),this.tok.T_DIV_EQUAL):"/"},":":function _(){return":"===this._input[this.offset]?(this.input(),this.tok.T_DOUBLE_COLON):":"},"(":function _(){var initial=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){var yylen=this.yytext.length;this.consume_LABEL();var castToken=this.yytext.substring(yylen-1).toLowerCase(),castId=this.castKeywords[castToken];if("number"==typeof castId&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return castId}return this.unput(this.offset-initial),"("},"=":function _(){var nchar=this._input[this.offset];return">"===nchar?(this.input(),this.tok.T_DOUBLE_ARROW):"="===nchar?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+":function _(){var nchar=this._input[this.offset];return"+"===nchar?(this.input(),this.tok.T_INC):"="===nchar?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!":function _(){return"="===this._input[this.offset]?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?":function _(){return this.php7&&"?"===this._input[this.offset]?(this.input(),this.tok.T_COALESCE):"?"},"<":function _(){var nchar=this._input[this.offset];return"<"===nchar?"="===(nchar=this._input[this.offset+1])?(this.consume(2),this.tok.T_SL_EQUAL):"<"===nchar&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),this.tok.T_SL):"="===nchar?(this.input(),this.php7&&">"===this._input[this.offset]?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):">"===nchar?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">":function _(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===nchar?"="===(nchar=this._input[this.offset+1])?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR):">"},"*":function _(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),this.tok.T_MUL_EQUAL):"*"===nchar?(this.input(),"="===this._input[this.offset]?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},".":function _(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),this.tok.T_CONCAT_EQUAL):"."===nchar&&"."===this._input[this.offset+1]?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%":function _(){return"="===this._input[this.offset]?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&":function _(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),this.tok.T_AND_EQUAL):"&"===nchar?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function _(){var nchar=this._input[this.offset];return"="===nchar?(this.input(),this.tok.T_OR_EQUAL):"|"===nchar?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^":function _(){return"="===this._input[this.offset]?(this.input(),this.tok.T_XOR_EQUAL):"^"}}}},function(module,exports,__webpack_require__){"use strict";module.exports={T_CONSTANT_ENCAPSED_STRING:function T_CONSTANT_ENCAPSED_STRING(){for(var ch=void 0;this.offset2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-prefix),this.unput(this.yytext.length-prefix),this.begin("ST_DOUBLE_QUOTES"),this.yytext},isDOC_MATCH:function isDOC_MATCH(){if(this._input.substring(this.offset-1,this.offset-1+this.heredoc_label.length)===this.heredoc_label){var ch=this._input[this.offset-1+this.heredoc_label.length];if("\n"===ch||"\r"===ch||";"===ch)return!0}return!1},matchST_NOWDOC:function matchST_NOWDOC(){if(this.isDOC_MATCH())return this.consume(this.heredoc_label.length),this.popState(),this.tok.T_END_HEREDOC;for(var ch=this._input[this.offset-1];this.offset2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var yyoffset=this.offset,next=this.consume_VARIABLE();return this.yytext.length>this.offset-yyoffset+2?(this.appendToken(next,this.offset-yyoffset+2),this.unput(this.offset-yyoffset+2),this.tok.T_ENCAPSED_AND_WHITESPACE):next}}else if("{"===ch){if("$"===(ch=this.input()))return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else ch=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE:function consume_VARIABLE(){this.consume_LABEL();var ch=this.input();if("["==ch)return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if("-"===ch){if(">"===this.input())return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else ch&&this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE:function matchST_BACKQUOTE(){var ch=this.input();if("$"===ch){if("{"===(ch=this.input()))return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if("{"===ch){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if("`"===ch)return this.popState(),"`";for(;this.offset2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var yyoffset=this.offset,next=this.consume_VARIABLE();return this.yytext.length>this.offset-yyoffset+2?(this.appendToken(next,this.offset-yyoffset+2),this.unput(this.offset-yyoffset+2),this.tok.T_ENCAPSED_AND_WHITESPACE):next}continue}if("{"===ch){if("$"===(ch=this.input()))return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);continue}}ch=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES:function matchST_DOUBLE_QUOTES(){var ch=this.input();if("$"===ch){if("{"===(ch=this.input()))return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if("{"===ch){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if('"'===ch)return this.popState(),'"';for(;this.offset2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var yyoffset=this.offset,next=this.consume_VARIABLE();return this.yytext.length>this.offset-yyoffset+2?(this.appendToken(next,this.offset-yyoffset+2),this.unput(this.offset-yyoffset+2),this.tok.T_ENCAPSED_AND_WHITESPACE):next}ch&&this.unput(1)}else if("{"===ch){if("$"===(ch=this.input()))return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);ch&&this.unput(1)}}ch=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}}},function(module,exports,__webpack_require__){"use strict";module.exports={matchST_IN_SCRIPTING:function matchST_IN_SCRIPTING(){var ch=this.input();switch(ch){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return this.T_COMMENT();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();var nextCH=this._input[this.offset];return"\n"!==nextCH&&"\r"!==nextCH||this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&">"===this._input[this.offset]?(this.input(),"\n"!==(ch=this._input[this.offset])&&"\r"!==ch||this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if("."===ch){if(ch=this.input(),this.is_NUM())return this.consume_NUM();ch&&this.unput(1)}if(this.is_NUM())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+ch+'" at line '+this.yylineno+" (offset "+this.offset+")")},T_WHITESPACE:function T_WHITESPACE(){for(;this.offset"===(ch=this.input()))return this.tok.T_OBJECT_OPERATOR;ch&&this.unput(1)}else{if(this.is_WHITESPACE())return this.tok.T_WHITESPACE;if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING}return this.popState(),ch&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME:function matchST_LOOKING_FOR_VARNAME(){var ch=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),"["===(ch=this.input())||"}"===ch)return this.unput(1),this.tok.T_STRING_VARNAME;this.unput(this.yytext.length)}else ch&&this.unput(1);return!1},matchST_VAR_OFFSET:function matchST_VAR_OFFSET(){var ch=this.input();if(this.is_NUM())return this.consume_NUM(),this.tok.T_NUM_STRING;if("]"===ch)return this.popState(),"]";if("$"===ch){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||"\\"===ch||"'"===ch||"#"===ch)return this.tok.T_ENCAPSED_AND_WHITESPACE;if("["===ch||"{"===ch||"}"===ch||'"'===ch||"`"===ch||this.is_TOKEN())return ch;throw new Error("Unexpected terminal")}}},function(module,exports){var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex1)for(var i=1;i1&&"INITIAL"===this.conditionStack[this.conditionStack.length-1]?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL:function matchINITIAL(){for(;this.offset0&&this.tok.T_INLINE_HTML}}},function(module,exports,__webpack_require__){"use strict";module.exports={T_COMMENT:function T_COMMENT(){for(;this.offset"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT;if("%"===ch&&this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT:function T_DOC_COMMENT(){var ch=this.input(),token=this.tok.T_COMMENT;if("*"===ch){if(ch=this.input(),this.is_WHITESPACE()&&(token=this.tok.T_DOC_COMMENT),"/"===ch)return token;this.unput(1)}for(;this.offset=this.size,!this.all_tokens&&this.mode_eval?(this.conditionStack=["INITIAL"],this.begin("ST_IN_SCRIPTING")):(this.conditionStack=[],this.begin("INITIAL")),this},lexer.prototype.input=function(){var ch=this._input[this.offset];return ch?(this.yytext+=ch,this.offset++,"\r"===ch&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++),"\n"===ch||"\r"===ch?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,ch):""},lexer.prototype.unput=function(size){if(1===size)this.offset--,"\n"===this._input[this.offset]&&"\r"===this._input[this.offset-1]&&(this.offset--,size++),"\r"===this._input[this.offset]||"\n"===this._input[this.offset]?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-size);else if(size>0)if(this.offset-=size,size0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+this.curCondition+'"');return condition},lexer.prototype.next=function(){var token=void 0;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?(token=this.tokens.shift(),"object"===_typeof(token[1])?this.setState(token[1]):this.consume(token[1]),token=token[0]):token=this.stateCb.apply(this,[]),this.offset>=this.size&&0===this.tokens.length&&(this.done=!0),this.debug){var tName=token;tName="number"==typeof tName?this.engine.tokens.values[tName]:'"'+tName+'"';var e=new Error(tName+"\tfrom "+this.yylloc.first_line+","+this.yylloc.first_column+"\t - to "+this.yylloc.last_line+","+this.yylloc.last_column+'\t"'+this.yytext+'"');console.error(e.stack)}return token},[__webpack_require__(115),__webpack_require__(114),__webpack_require__(113),__webpack_require__(111),__webpack_require__(110),__webpack_require__(109),__webpack_require__(108),__webpack_require__(107)].forEach(function(ext){for(var k in ext)lexer.prototype[k]=ext[k]}),module.exports=lexer},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),(value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias))*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},function(module,exports,__webpack_require__){"use strict";exports.byteLength=function byteLength(b64){var lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1];return 3*(validLen+placeHoldersLen)/4-placeHoldersLen},exports.toByteArray=function toByteArray(b64){for(var tmp,lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1],arr=new Arr(function _byteLength(b64,validLen,placeHoldersLen){return 3*(validLen+placeHoldersLen)/4-placeHoldersLen}(0,validLen,placeHoldersLen)),curByte=0,len=placeHoldersLen>0?validLen-4:validLen,i=0;i>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp;2===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=255&tmp);1===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp);return arr},exports.fromByteArray=function fromByteArray(uint8){for(var tmp,len=uint8.length,extraBytes=len%3,parts=[],i=0,len2=len-extraBytes;ilen2?len2:i+16383));1===extraBytes?(tmp=uint8[len-1],parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"="));return parts.join("")};for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var validLen=b64.indexOf("=");return-1===validLen&&(validLen=len),[validLen,validLen===len?0:4-validLen%4]}function encodeChunk(uint8,start,end){for(var tmp,num,output=[],i=start;i>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]);return output.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63},function(module,exports){var g;g=function(){return this}();try{g=g||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports,__webpack_require__){"use strict";(function(global){ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -var base64=__webpack_require__(119),ieee754=__webpack_require__(118),isArray=__webpack_require__(117);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var i,indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;jremaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end)switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:128==(192&(secondByte=buf[i+1]))&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);var res="",i=0;for(;ithis.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if((end>>>=0)<=(start>>>=0))return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}.apply(this,arguments)},Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function inspect(){var str="",max=exports.INSPECT_MAX_BYTES;return this.length>0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),""},Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;iremaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;ilen)&&(end=len);for(var out="",i=start;ilength)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,4),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,8),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}Buffer.prototype.slice=function slice(start,end){var newBuf,len=this.length;if(start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i=(mul*=128)&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return val>=(mul*=128)&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function readInt8(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?-1*(255-this[offset]+1):this[offset]},Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){(value=+value,offset|=0,byteLength|=0,noAssert)||checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0);var mul=1,i=0;for(this[offset]=255&value;++i=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function copy(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,end=void 0===end?this.length:end>>>0,val||(val=0),"number"==typeof val)for(i=start;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function base64ToBytes(str){return base64.toByteArray(function base64clean(str){if((str=function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}(str).replace(INVALID_BASE64_RE,"")).length<2)return"";for(;str.length%4!=0;)str+="=";return str}(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}}).call(this,__webpack_require__(120))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){ -/*! - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},lexer=__webpack_require__(116),parser=__webpack_require__(106),tokens=__webpack_require__(90),AST=__webpack_require__(89);function combine(src,to){for(var keys=Object.keys(src),i=keys.length;i--;){var k=keys[i],val=src[k];null===val?delete to[k]:"function"==typeof val?to[k]=val.bind(to):Array.isArray(val)?to[k]=Array.isArray(to[k])?to[k].concat(val):val:"object"===(void 0===val?"undefined":_typeof(val))?to[k]="object"===_typeof(to[k])?combine(val,to[k]):val:to[k]=val}return to}var engine=function engine(options){if("function"==typeof this)return new this(options);this.tokens=tokens,this.lexer=new lexer(this),this.ast=new AST,this.parser=new parser(this.lexer,this.ast),options&&"object"===(void 0===options?"undefined":_typeof(options))&&(options.parser&&!1===options.parser.php7&&(options.lexer||(options.lexer={}),options.lexer.php7=!1),combine(options,this))},getStringBuffer=function getStringBuffer(buffer){return Buffer.isBuffer(buffer)?buffer.toString():buffer};engine.create=function(options){return new engine(options)},engine.parseEval=function(buffer,options){return new engine(options).parseEval(buffer)},engine.prototype.parseEval=function(buffer){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,buffer=getStringBuffer(buffer),this.parser.parse(buffer,"eval")},engine.parseCode=function(buffer,filename,options){return"object"===(void 0===filename?"undefined":_typeof(filename))&&(options=filename,filename="unknown"),new engine(options).parseCode(buffer,filename)},engine.prototype.parseCode=function(buffer,filename){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,buffer=getStringBuffer(buffer),this.parser.parse(buffer,filename)},engine.tokenGetAll=function(buffer,options){return new engine(options).tokenGetAll(buffer)},engine.prototype.tokenGetAll=function(buffer){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,buffer=getStringBuffer(buffer);var EOF=this.lexer.EOF,names=this.tokens.values;this.lexer.setInput(buffer);for(var token=this.lexer.lex()||EOF,result=[];token!=EOF;){var entry=this.lexer.yytext;names.hasOwnProperty(token)&&(entry=[names[token],entry,this.lexer.yylloc.first_line]),result.push(entry),token=this.lexer.lex()||EOF}return result},module.exports=engine,module.exports.tokens=tokens,module.exports.lexer=lexer,module.exports.AST=AST,module.exports.parser=parser,module.exports.combine=combine,module.exports.default=engine}).call(this,__webpack_require__(121).Buffer)}]).default}); \ No newline at end of file diff --git a/engine.html b/engine.html new file mode 100644 index 000000000..a9ffdd94b --- /dev/null +++ b/engine.html @@ -0,0 +1,965 @@ + + + + + + + + + engine - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ engine +

+ + + + +
+
+ +

+ + engine + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new engine(options) +

+
+ + + + + +
+

Initialise a new parser instance with the specified options

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + + + Object + + + + + + + +

List of options

+ +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
lexer + + + + Lexer + + + + + + + + +
parser + + + + Parser + + + + + + + + +
ast + + + + AST + + + + + + + + +
tokens + + + + Object + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + +
Tutorials:
+
+ +
+ + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
Example
+ + +
var parser = require('php-parser');
var instance = new parser({
  parser: {
    extractDoc: true,
    suppressErrors: true,
    php7: true
  },
  ast: {
    withPositions: true
  },
  lexer: {
    short_tags: true,
    asp_tags: true
  }
});

var evalAST = instance.parseEval('some php code');
var codeAST = instance.parseCode('<?php some php code', 'foo.php');
var tokens = instance.tokenGetAll('<?php some php code');
+ + +
+ + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ parseCode(buffer, filename) → {Program} +

+
+ + + + + +
+

Function that parse a php code with open/close tags

+

Sample code :

+
<?php $x = 1;

Usage :

+
var parser = require('php-parser');
+var phpParser = new parser({
+  // some options
+});
+var ast = phpParser.parseCode('...php code...', 'foo.php');
+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
buffer + + + + String + + + + + + + +

The code to be parsed

+ +
filename + + + + String + + + + + + + +

Filename

+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parseEval(buffer) → {Program} +

+
+ + + + + +
+

Parse an evaluating mode string (no need to open php tags)

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
buffer + + + + String + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ tokenGetAll(buffer) → {Array.<String>} +

+
+ + + + + +
+

Extract tokens from the specified buffer.

+
+

Note that the output tokens are STRICLY similar to PHP function token_get_all

+
+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
buffer + + + + String + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/OpenSans-Bold-webfont.eot b/fonts/OpenSans-Bold-webfont.eot new file mode 100644 index 000000000..5d20d9163 Binary files /dev/null and b/fonts/OpenSans-Bold-webfont.eot differ diff --git a/fonts/OpenSans-Bold-webfont.svg b/fonts/OpenSans-Bold-webfont.svg new file mode 100644 index 000000000..3ed7be4bc --- /dev/null +++ b/fonts/OpenSans-Bold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/OpenSans-Bold-webfont.woff b/fonts/OpenSans-Bold-webfont.woff new file mode 100644 index 000000000..1205787b0 Binary files /dev/null and b/fonts/OpenSans-Bold-webfont.woff differ diff --git a/fonts/OpenSans-BoldItalic-webfont.eot b/fonts/OpenSans-BoldItalic-webfont.eot new file mode 100644 index 000000000..1f639a15f Binary files /dev/null and b/fonts/OpenSans-BoldItalic-webfont.eot differ diff --git a/fonts/OpenSans-BoldItalic-webfont.svg b/fonts/OpenSans-BoldItalic-webfont.svg new file mode 100644 index 000000000..6a2607b9d --- /dev/null +++ b/fonts/OpenSans-BoldItalic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/OpenSans-BoldItalic-webfont.woff b/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100644 index 000000000..ed760c062 Binary files /dev/null and b/fonts/OpenSans-BoldItalic-webfont.woff differ diff --git a/fonts/OpenSans-Italic-webfont.eot b/fonts/OpenSans-Italic-webfont.eot new file mode 100644 index 000000000..0c8a0ae06 Binary files /dev/null and b/fonts/OpenSans-Italic-webfont.eot differ diff --git a/fonts/OpenSans-Italic-webfont.svg b/fonts/OpenSans-Italic-webfont.svg new file mode 100644 index 000000000..e1075dcc2 --- /dev/null +++ b/fonts/OpenSans-Italic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/OpenSans-Italic-webfont.woff b/fonts/OpenSans-Italic-webfont.woff new file mode 100644 index 000000000..ff652e643 Binary files /dev/null and b/fonts/OpenSans-Italic-webfont.woff differ diff --git a/fonts/OpenSans-Light-webfont.eot b/fonts/OpenSans-Light-webfont.eot new file mode 100644 index 000000000..14868406a Binary files /dev/null and b/fonts/OpenSans-Light-webfont.eot differ diff --git a/fonts/OpenSans-Light-webfont.svg b/fonts/OpenSans-Light-webfont.svg new file mode 100644 index 000000000..11a472ca8 --- /dev/null +++ b/fonts/OpenSans-Light-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/OpenSans-Light-webfont.woff b/fonts/OpenSans-Light-webfont.woff new file mode 100644 index 000000000..e78607481 Binary files /dev/null and b/fonts/OpenSans-Light-webfont.woff differ diff --git a/fonts/OpenSans-LightItalic-webfont.eot b/fonts/OpenSans-LightItalic-webfont.eot new file mode 100644 index 000000000..8f445929f Binary files /dev/null and b/fonts/OpenSans-LightItalic-webfont.eot differ diff --git a/fonts/OpenSans-LightItalic-webfont.svg b/fonts/OpenSans-LightItalic-webfont.svg new file mode 100644 index 000000000..431d7e354 --- /dev/null +++ b/fonts/OpenSans-LightItalic-webfont.svg @@ -0,0 +1,1835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/OpenSans-LightItalic-webfont.woff b/fonts/OpenSans-LightItalic-webfont.woff new file mode 100644 index 000000000..43e8b9e6c Binary files /dev/null and b/fonts/OpenSans-LightItalic-webfont.woff differ diff --git a/fonts/OpenSans-Regular-webfont.eot b/fonts/OpenSans-Regular-webfont.eot new file mode 100644 index 000000000..6bbc3cf58 Binary files /dev/null and b/fonts/OpenSans-Regular-webfont.eot differ diff --git a/fonts/OpenSans-Regular-webfont.svg b/fonts/OpenSans-Regular-webfont.svg new file mode 100644 index 000000000..25a395234 --- /dev/null +++ b/fonts/OpenSans-Regular-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/OpenSans-Regular-webfont.woff b/fonts/OpenSans-Regular-webfont.woff new file mode 100644 index 000000000..e231183dc Binary files /dev/null and b/fonts/OpenSans-Regular-webfont.woff differ diff --git a/fonts/OpenSans-Semibold-webfont.eot b/fonts/OpenSans-Semibold-webfont.eot new file mode 100644 index 000000000..d8375dd0a Binary files /dev/null and b/fonts/OpenSans-Semibold-webfont.eot differ diff --git a/fonts/OpenSans-Semibold-webfont.svg b/fonts/OpenSans-Semibold-webfont.svg new file mode 100644 index 000000000..eec4db8bd --- /dev/null +++ b/fonts/OpenSans-Semibold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/OpenSans-Semibold-webfont.ttf b/fonts/OpenSans-Semibold-webfont.ttf new file mode 100644 index 000000000..b3290843a Binary files /dev/null and b/fonts/OpenSans-Semibold-webfont.ttf differ diff --git a/fonts/OpenSans-Semibold-webfont.woff b/fonts/OpenSans-Semibold-webfont.woff new file mode 100644 index 000000000..28d6adee0 Binary files /dev/null and b/fonts/OpenSans-Semibold-webfont.woff differ diff --git a/fonts/OpenSans-SemiboldItalic-webfont.eot b/fonts/OpenSans-SemiboldItalic-webfont.eot new file mode 100644 index 000000000..0ab1db22e Binary files /dev/null and b/fonts/OpenSans-SemiboldItalic-webfont.eot differ diff --git a/fonts/OpenSans-SemiboldItalic-webfont.svg b/fonts/OpenSans-SemiboldItalic-webfont.svg new file mode 100644 index 000000000..7166ec1b9 --- /dev/null +++ b/fonts/OpenSans-SemiboldItalic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/OpenSans-SemiboldItalic-webfont.ttf b/fonts/OpenSans-SemiboldItalic-webfont.ttf new file mode 100644 index 000000000..d2d6318f6 Binary files /dev/null and b/fonts/OpenSans-SemiboldItalic-webfont.ttf differ diff --git a/fonts/OpenSans-SemiboldItalic-webfont.woff b/fonts/OpenSans-SemiboldItalic-webfont.woff new file mode 100644 index 000000000..d4dfca402 Binary files /dev/null and b/fonts/OpenSans-SemiboldItalic-webfont.woff differ diff --git a/global.html b/global.html new file mode 100644 index 000000000..2f19d9bb6 --- /dev/null +++ b/global.html @@ -0,0 +1,1336 @@ + + + + + + + + + Global - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Global +

+ + + + +
+
+ +

+ + + +

+ + + +
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + + +

+ (constant) FULL_QUALIFIED_NAME :String +

+ + + + +
+

This is an identifier with a namespace separator that begins with +a namespace separator, such as \Foo\Bar. The namespace \Foo is also +a fully qualified name.

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) ignoreStack +

+ + + + +
+

outputs some debug information on current token

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) MODE_BLOCK :String +

+ + + + +
+

The node is declared bracket enclosed code :

+
<?php
+declare(ticks=1) {
+// some statements
+}
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) MODE_NONE :String +

+ + + + +
+

The node is declared as a simple statement. In order to make things simpler +children of the node are automatically collected until the next +declare statement.

+
<?php
+declare(ticks=1);
+// some statements
+declare(ticks=2);
+// some statements
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) MODE_SHORT :String +

+ + + + +
+

The node is declared as a short tag syntax :

+
<?php
+declare(ticks=1):
+// some statements
+enddeclare;
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) QUALIFIED_NAME :String +

+ + + + +
+

This is an identifier with a namespace separator, such as Foo\Bar

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) RELATIVE_NAME :String +

+ + + + +
+

This is an identifier starting with namespace, such as namespace\Foo\Bar.

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) TYPE_CONST :String +

+ + + + +
+

Importing a constant

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) TYPE_FUNC :String +

+ + + + +
+

Importing a function

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) TYPE_HEREDOC :String +

+ + + + +
+

The node is a shell execute string :

+
<?php
+echo <<<STR
+ Hello $world
+STR
+;
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) TYPE_OFFSET :String +

+ + + + +
+

The node contains a list of constref / variables / expr :

+
<?php
+echo $foo->bar_$baz;
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) TYPE_SHELL :String +

+ + + + +
+

The node is a shell execute string :

+
<?php
+echo `ls -larth $path`;
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) TYPE_STRING :String +

+ + + + +
+

The node is a double quote string :

+
<?php
+echo "hello $world";
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + +

+ (constant) UNQUALIFIED_NAME :String +

+ + + + +
+

This is an identifier without a namespace separator, such as Foo

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ getStringBuffer(buffer) → {String} +

+
+ + + + + +
+

Check if the inpyt is a buffer or a string

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
buffer + + + + Buffer + + + | + + + String + + + + + + + +

Input value that can be either a buffer or a string

+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/icons/home.svg b/icons/home.svg new file mode 100644 index 000000000..676d2d385 --- /dev/null +++ b/icons/home.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/icons/search.svg b/icons/search.svg new file mode 100644 index 000000000..ccc84b62c --- /dev/null +++ b/icons/search.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 6d72fb1b6..000000000 --- a/index.d.ts +++ /dev/null @@ -1,364 +0,0 @@ -/*! - * Copyright (C) 2017 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - -declare module "php-parser" { - /** - * Token items - */ - const enum TokenEnum { - T_HALT_COMPILER = 101, - T_USE = 102, - T_ENCAPSED_AND_WHITESPACE = 103, - T_OBJECT_OPERATOR = 104, - T_STRING = 105, - T_DOLLAR_OPEN_CURLY_BRACES = 106, - T_STRING_VARNAME = 107, - T_CURLY_OPEN = 108, - T_NUM_STRING = 109, - T_ISSET = 110, - T_EMPTY = 111, - T_INCLUDE = 112, - T_INCLUDE_ONCE = 113, - T_EVAL = 114, - T_REQUIRE = 115, - T_REQUIRE_ONCE = 116, - T_NAMESPACE = 117, - T_NS_SEPARATOR = 118, - T_AS = 119, - T_IF = 120, - T_ENDIF = 121, - T_WHILE = 122, - T_DO = 123, - T_FOR = 124, - T_SWITCH = 125, - T_BREAK = 126, - T_CONTINUE = 127, - T_RETURN = 128, - T_GLOBAL = 129, - T_STATIC = 130, - T_ECHO = 131, - T_INLINE_HTML = 132, - T_UNSET = 133, - T_FOREACH = 134, - T_DECLARE = 135, - T_TRY = 136, - T_THROW = 137, - T_GOTO = 138, - T_FINALLY = 139, - T_CATCH = 140, - T_ENDDECLARE = 141, - T_LIST = 142, - T_CLONE = 143, - T_PLUS_EQUAL = 144, - T_MINUS_EQUAL = 145, - T_MUL_EQUAL = 146, - T_DIV_EQUAL = 147, - T_CONCAT_EQUAL = 148, - T_MOD_EQUAL = 149, - T_AND_EQUAL = 150, - T_OR_EQUAL = 151, - T_XOR_EQUAL = 152, - T_SL_EQUAL = 153, - T_SR_EQUAL = 154, - T_INC = 155, - T_DEC = 156, - T_BOOLEAN_OR = 157, - T_BOOLEAN_AND = 158, - T_LOGICAL_OR = 159, - T_LOGICAL_AND = 160, - T_LOGICAL_XOR = 161, - T_SL = 162, - T_SR = 163, - T_IS_IDENTICAL = 164, - T_IS_NOT_IDENTICAL = 165, - T_IS_EQUAL = 166, - T_IS_NOT_EQUAL = 167, - T_IS_SMALLER_OR_EQUAL = 168, - T_IS_GREATER_OR_EQUAL = 169, - T_INSTANCEOF = 170, - T_INT_CAST = 171, - T_DOUBLE_CAST = 172, - T_STRING_CAST = 173, - T_ARRAY_CAST = 174, - T_OBJECT_CAST = 175, - T_BOOL_CAST = 176, - T_UNSET_CAST = 177, - T_EXIT = 178, - T_PRINT = 179, - T_YIELD = 180, - T_YIELD_FROM = 181, - T_FUNCTION = 182, - T_DOUBLE_ARROW = 183, - T_DOUBLE_COLON = 184, - T_ARRAY = 185, - T_CALLABLE = 186, - T_CLASS = 187, - T_ABSTRACT = 188, - T_TRAIT = 189, - T_FINAL = 190, - T_EXTENDS = 191, - T_INTERFACE = 192, - T_IMPLEMENTS = 193, - T_VAR = 194, - T_PUBLIC = 195, - T_PROTECTED = 196, - T_PRIVATE = 197, - T_CONST = 198, - T_NEW = 199, - T_INSTEADOF = 200, - T_ELSEIF = 201, - T_ELSE = 202, - T_ENDSWITCH = 203, - T_CASE = 204, - T_DEFAULT = 205, - T_ENDFOR = 206, - T_ENDFOREACH = 207, - T_ENDWHILE = 208, - T_CONSTANT_ENCAPSED_STRING = 209, - T_LNUMBER = 210, - T_DNUMBER = 211, - T_LINE = 212, - T_FILE = 213, - T_DIR = 214, - T_TRAIT_C = 215, - T_METHOD_C = 216, - T_FUNC_C = 217, - T_NS_C = 218, - T_START_HEREDOC = 219, - T_END_HEREDOC = 220, - T_CLASS_C = 221, - T_VARIABLE = 222, - T_OPEN_TAG = 223, - T_OPEN_TAG_WITH_ECHO = 224, - T_CLOSE_TAG = 225, - T_WHITESPACE = 226, - T_COMMENT = 227, - T_DOC_COMMENT = 228, - T_ELLIPSIS = 229, - T_COALESCE = 230, - T_POW = 231, - T_POW_EQUAL = 232, - T_SPACESHIP = 233 - } - - /** - * The tokens dictionnary - */ - interface TokenDefinition { - /** List of token names as texts */ - values: String[], - /** Define tokens */ - names: TokenEnum[] - } - - /** - * The token structure - */ - interface Token extends Array { - // token name - 0: String; - // the token value - 1: TokenEnum; - // the current line - 2: Number - } - - /** - * Each Position object consists of a line number (1-indexed) and a column number (0-indexed): - */ - interface Position { - line: Number; - column: Number; - offset: Number; - } - - /** - * Defines the location of the node (with it's source contents as string) - */ - interface Location { - source: string; - start: Position; - end: Position; - } - - /** - * - */ - interface Node { - kind: String; - loc: Location; - } - - /** - * Error node - */ - interface ParserError extends Node { - message: String; - token: Token; - line: Number; - expected: any; - } - - /** - * A block statement, i.e., a sequence of statements surrounded by braces. - */ - interface Block extends Node { - children: Node[]; - } - - /** - * The main root node - */ - interface Program extends Block { - errors: ParserError[]; - } - - interface Parser { - lexer: Lexer; - ast: AST; - token: TokenEnum; - prev: TokenEnum; - debug: Boolean; - extractDoc: Boolean; - suppressErrors: Boolean; - getTokenName(token:TokenEnum): String; - parse(code: String, filename: String): Program; - raiseError(message: String, msgExpect: String, expect: any, token: TokenEnum): ParserError; - error(expect: String): ParserError; - node(kind:String): Node; - expectEndOfStatement(): Boolean; - showlog(): Parser; - expect(token:TokenEnum): Boolean; - expect(tokens:TokenEnum[]): Boolean; - text(): String; - next(): Parser; - ignoreComments(): Parser; - nextWithComments(): Parser; - is(type: String): Boolean; - // @todo other parsing functions ... - } - - interface KeywordsDictionnary { - [index: string]: TokenEnum - } - - interface yylloc { - first_offset: Number; - first_line: Number; - first_column: Number; - last_line: Number; - last_column: Number; - } - - interface LexerState { - yytext: String; - offset: Number; - yylineno: Number; - yyprevcol: Number; - yylloc: yylloc; - } - - interface Lexer { - debug: Boolean; - all_tokens: Boolean; - comment_tokens: Boolean; - mode_eval: Boolean; - asp_tags: Boolean; - short_tags: Boolean; - keywords: KeywordsDictionnary; - castKeywords: KeywordsDictionnary; - setInput(input:String): Lexer; - input(size:Number): String; - unput(size:Number): Lexer; - tryMatch(match:String): Boolean; - tryMatchCaseless(match:String): Boolean; - ahead(size:Number): String; - consume(size:Number): Lexer; - getState(): LexerState; - setState(state:LexerState): Lexer; - appendToken(value:TokenEnum, ahead:Number): Lexer; - lex(): TokenEnum; - begin(state:String): Lexer; - popState(): String; - next(): TokenEnum; - // @todo other lexer functions ... - } - - - interface AST { - /** - * - */ - withPositions: Boolean; - /** - * Option, if true extracts original source code attached to the node (by default false) - */ - withSource: Boolean; - /** - * Constructor - */ - constructor(withPositions:Boolean, withSource:Boolean): AST; - constructor(withPositions:Boolean): AST; - constructor(): AST; - /** - * Create a position node from specified parser - * including it's lexer current state - */ - position(parser:Parser): Position; - /** - * Prepares an AST node - */ - prepare(kind:String, parser:Parser): Function; - } - - /** - * List of options / extensions - */ - interface Options { - ast?: { - withPositions?: Boolean; - withSource?: Boolean; - }; - lexer?: { - debug?: Boolean; - all_tokens?: Boolean; - comment_tokens?: Boolean; - mode_eval?: Boolean; - asp_tags?: Boolean; - short_tags?: Boolean; - }; - parser?: { - debug?: Boolean; - extractDoc?: Boolean; - suppressErrors?: Boolean; - }; - } - - /** - * Initialise a new parser instance with the specified options - */ - export default class Engine { - // ----- STATIC HELPERS - static create(options?: Options) : Engine; - static parseEval(buffer: String, options: Options) : Program; - static parseEval(buffer: String) : Program; - static parseCode(buffer: String, filename: String, options: Options) : Program; - static parseCode(buffer: String, options: Options) : Program; - static parseCode(buffer: String) : Program; - static tokenGetAll(buffer: String, options: Options) : Token[]; - static tokenGetAll(buffer: String) : Token[]; - // ----- INSTANCE FUNCTIONS - ast: AST; - lexer: Lexer; - parser: Parser; - tokens: TokenDefinition; - constructor(options?: Options); - parseEval(buffer: String) : Program; - parseCode(buffer: String, filename: String) : Program; - parseCode(buffer: String) : Program; - tokenGetAll(buffer: String) : Token[]; - } -} diff --git a/index.html b/index.html new file mode 100644 index 000000000..fb3ea75a0 --- /dev/null +++ b/index.html @@ -0,0 +1,237 @@ + + + + + + + + + Home - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + + + + + + + + + + +
+
+

php-parser

+

+ +Coverage Status + + + + +

+

This javascript library parses PHP code and convert it to AST.

+ +

Installation

+

This library is distributed with npm :

+
npm install php-parser --save

Usage

+
// initialize the php parser factory class
+var fs = require('fs');
+var path = require('path');
+var engine = require('php-parser');
+
+// initialize a new parser instance
+var parser = new engine({
+  // some options :
+  parser: {
+    extractDoc: true,
+    php7: true
+  },
+  ast: {
+    withPositions: true
+  }
+});
+
+// Retrieve the AST from the specified source
+var eval = parser.parseEval('echo "Hello World";');
+
+// Retrieve an array of tokens (same as php function token_get_all)
+var tokens = parser.tokenGetAll('<?php echo "Hello World";');
+
+// Load a static file (Note: this file should exist on your computer)
+var phpFile = fs.readFileSync( './example.php' );
+
+// Log out results
+console.log( 'Eval parse:', eval );
+console.log( 'Tokens parse:', tokens );
+console.log( 'File parse:', parser.parseCode(phpFile) );
+

Sample AST output

+
{
+  'kind': 'program',
+  'children': [
+    {
+      'kind': 'echo',
+      'arguments': [
+        {
+          'kind': 'string',
+          'isDoubleQuote': true,
+          'value': 'Hello World'
+        }
+      ]
+    }
+  ]
+}
    +
  • Try it online (demo) : http://glayzzle.com/php-parser/
  • +
  • Or from AST Explorer : https://astexplorer.net/
  • +
+

API Overview

+

The main API exposes a class with the following methods :

+
    +
  • parseEval(String|Buffer) : parse a PHP code in eval style mode (without php open tags)
  • +
  • parseCode(String|Buffer, String filename) : parse a PHP code by using php open tags.
  • +
  • tokenGetAll(String|Buffer) : retrieves a list of all tokens from the specified input.
  • +
+

You can also pass options that change the behavior of the parser/lexer.

+

Documentation

+ + +
    +
  • prettier/plugin-php : Prettier PHP Plugin
  • +
  • babel-preset-php : Babel preset for converting PHP syntax to JavaScript. It can run subset of PHP in the browser or in Node.js
  • +
  • wp-pot : Generate pot file for WordPress plugins and themes
  • +
  • crane : PHP Intellisense/code-completion for VS Code
  • +
  • php-unparser : Produce code that uses the style format recommended by PSR-1 and PSR-2.
  • +
  • php-writer : Update PHP scripts from their AST
  • +
  • ts-php-inspections : Provide PHP code inspections written in typescript
  • +
  • php-reflection : Reflection API for PHP files
  • +
  • vscode-phpunit : vscode phpunit extension
  • +
+
+

You can add here your own project by opening an issue request.

+
+

License

+

This library is released under BSD-3 license clause.

+

FOSSA Status

+
+
+ + + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/index.js.html b/index.js.html new file mode 100644 index 000000000..6c08d5d54 --- /dev/null +++ b/index.js.html @@ -0,0 +1,355 @@ + + + + + + + + + + + index.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ index.js +

+ + + + + +
+
+
/*!
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const lexer = require("./lexer");
+const parser = require("./parser");
+const tokens = require("./tokens");
+const AST = require("./ast");
+
+/**
+ * @private
+ */
+function combine(src, to) {
+  const keys = Object.keys(src);
+  let i = keys.length;
+  while (i--) {
+    const k = keys[i];
+    const val = src[k];
+    if (val === null) {
+      delete to[k];
+    } else if (typeof val === "function") {
+      to[k] = val.bind(to);
+    } else if (Array.isArray(val)) {
+      to[k] = Array.isArray(to[k]) ? to[k].concat(val) : val;
+    } else if (typeof val === "object") {
+      to[k] = typeof to[k] === "object" ? combine(val, to[k]) : val;
+    } else {
+      to[k] = val;
+    }
+  }
+  return to;
+}
+
+/**
+ * Initialise a new parser instance with the specified options
+ *
+ * @class
+ * @tutorial Engine
+ * @example
+ * var parser = require('php-parser');
+ * var instance = new parser({
+ *   parser: {
+ *     extractDoc: true,
+ *     suppressErrors: true,
+ *     php7: true
+ *   },
+ *   ast: {
+ *     withPositions: true
+ *   },
+ *   lexer: {
+ *     short_tags: true,
+ *     asp_tags: true
+ *   }
+ * });
+ *
+ * var evalAST = instance.parseEval('some php code');
+ * var codeAST = instance.parseCode('<?php some php code', 'foo.php');
+ * var tokens = instance.tokenGetAll('<?php some php code');
+ *
+ * @param {Object} options - List of options
+ * @property {Lexer} lexer
+ * @property {Parser} parser
+ * @property {AST} ast
+ * @property {Object} tokens
+ */
+const engine = function(options) {
+  if (typeof this === "function") {
+    return new this(options);
+  }
+  this.tokens = tokens;
+  this.lexer = new lexer(this);
+  this.ast = new AST();
+  this.parser = new parser(this.lexer, this.ast);
+  if (options && typeof options === "object") {
+    // disable php7 from lexer if already disabled from parser
+    if (options.parser && options.parser.php7 === false) {
+      if (!options.lexer) {
+        options.lexer = {};
+      }
+      options.lexer.php7 = false;
+    }
+    combine(options, this);
+  }
+};
+
+/**
+ * Check if the inpyt is a buffer or a string
+ * @param  {Buffer|String} buffer Input value that can be either a buffer or a string
+ * @return {String}   Returns the string from input
+ */
+const getStringBuffer = function(buffer) {
+  return Buffer.isBuffer(buffer) ? buffer.toString() : buffer;
+};
+
+/**
+ * Creates a new instance (Helper)
+ * @param {Object} options
+ * @return {Engine}
+ * @private
+ */
+engine.create = function(options) {
+  return new engine(options);
+};
+
+/**
+ * Evaluate the buffer
+ * @private
+ */
+engine.parseEval = function(buffer, options) {
+  const self = new engine(options);
+  return self.parseEval(buffer);
+};
+
+/**
+ * Parse an evaluating mode string (no need to open php tags)
+ * @param {String} buffer
+ * @return {Program}
+ */
+engine.prototype.parseEval = function(buffer) {
+  this.lexer.mode_eval = true;
+  this.lexer.all_tokens = false;
+  buffer = getStringBuffer(buffer);
+  return this.parser.parse(buffer, "eval");
+};
+
+/**
+ * Static function that parse a php code with open/close tags
+ * @private
+ */
+engine.parseCode = function(buffer, filename, options) {
+  if (typeof filename === "object") {
+    // retro-compatibility
+    options = filename;
+    filename = "unknown";
+  }
+  const self = new engine(options);
+  return self.parseCode(buffer, filename);
+};
+
+/**
+ * Function that parse a php code with open/close tags
+ *
+ * Sample code :
+ * ```php
+ * <?php $x = 1;
+ * ```
+ *
+ * Usage :
+ * ```js
+ * var parser = require('php-parser');
+ * var phpParser = new parser({
+ *   // some options
+ * });
+ * var ast = phpParser.parseCode('...php code...', 'foo.php');
+ * ```
+ * @param {String} buffer - The code to be parsed
+ * @param {String} filename - Filename
+ * @return {Program}
+ */
+engine.prototype.parseCode = function(buffer, filename) {
+  this.lexer.mode_eval = false;
+  this.lexer.all_tokens = false;
+  buffer = getStringBuffer(buffer);
+  return this.parser.parse(buffer, filename);
+};
+
+/**
+ * Split the buffer into tokens
+ * @private
+ */
+engine.tokenGetAll = function(buffer, options) {
+  const self = new engine(options);
+  return self.tokenGetAll(buffer);
+};
+
+/**
+ * Extract tokens from the specified buffer.
+ * > Note that the output tokens are *STRICLY* similar to PHP function `token_get_all`
+ * @param {String} buffer
+ * @return {String[]} - Each item can be a string or an array with following informations [token_name, text, line_number]
+ */
+engine.prototype.tokenGetAll = function(buffer) {
+  this.lexer.mode_eval = false;
+  this.lexer.all_tokens = true;
+  buffer = getStringBuffer(buffer);
+  const EOF = this.lexer.EOF;
+  const names = this.tokens.values;
+  this.lexer.setInput(buffer);
+  let token = this.lexer.lex() || EOF;
+  const result = [];
+  while (token != EOF) {
+    let entry = this.lexer.yytext;
+    if (names.hasOwnProperty(token)) {
+      entry = [names[token], entry, this.lexer.yylloc.first_line];
+    }
+    result.push(entry);
+    token = this.lexer.lex() || EOF;
+  }
+  return result;
+};
+
+// exports the function
+module.exports = engine;
+
+// makes libraries public
+module.exports.tokens = tokens;
+module.exports.lexer = lexer;
+module.exports.AST = AST;
+module.exports.parser = parser;
+module.exports.combine = combine;
+
+// allow the default export in index.d.ts
+module.exports.default = engine;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/lexer.html b/lexer.html new file mode 100644 index 000000000..d3c1ed59d --- /dev/null +++ b/lexer.html @@ -0,0 +1,980 @@ + + + + + + + + + lexer - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ lexer +

+ + + + +
+
+ +

+ + lexer + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new lexer() +

+
+ + + + + +
+

This is the php lexer. It will tokenize the string for helping the +parser to build the AST from its grammar.

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
EOF + + + + Integer + + + + + + + + +
all_tokens + + + + Boolean + + + + + + + +

defines if all tokens must be retrieved (used by token_get_all only)

+
comment_tokens + + + + Boolean + + + + + + + +

extracts comments tokens

+
mode_eval + + + + Boolean + + + + + + + +

enables the evald mode (ignore opening tags)

+
asp_tags + + + + Boolean + + + + + + + +

disables by default asp tags mode

+
short_tags + + + + Boolean + + + + + + + +

enables by default short tags mode

+
keywords + + + + Object + + + + + + + +

List of php keyword

+
castKeywords + + + + Object + + + + + + + +

List of php keywords for type casting

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ getState() +

+
+ + + + + +
+

Gets the current state

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ input() +

+
+ + + + + +
+

consumes and returns one char from the input

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ setInput() +

+
+ + + + + +
+

Initialize the lexer with the specified input

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ setState() +

+
+ + + + + +
+

Sets the current lexer state

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ unput() +

+
+ + + + + +
+

revert eating specified size

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/lexer.js.html b/lexer.js.html new file mode 100644 index 000000000..659971fc3 --- /dev/null +++ b/lexer.js.html @@ -0,0 +1,600 @@ + + + + + + + + + + + lexer.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ lexer.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+/**
+ * This is the php lexer. It will tokenize the string for helping the
+ * parser to build the AST from its grammar.
+ *
+ * @class
+ * @property {Integer} EOF
+ * @property {Boolean} all_tokens defines if all tokens must be retrieved (used by token_get_all only)
+ * @property {Boolean} comment_tokens extracts comments tokens
+ * @property {Boolean} mode_eval enables the evald mode (ignore opening tags)
+ * @property {Boolean} asp_tags disables by default asp tags mode
+ * @property {Boolean} short_tags enables by default short tags mode
+ * @property {Object} keywords List of php keyword
+ * @property {Object} castKeywords List of php keywords for type casting
+ */
+const lexer = function(engine) {
+  this.engine = engine;
+  this.tok = this.engine.tokens.names;
+  this.EOF = 1;
+  this.debug = false;
+  this.all_tokens = true;
+  this.comment_tokens = false;
+  this.mode_eval = false;
+  this.asp_tags = false;
+  this.short_tags = true;
+  this.php7 = true;
+  this.yyprevcol = 0;
+  this.keywords = {
+    __class__: this.tok.T_CLASS_C,
+    __trait__: this.tok.T_TRAIT_C,
+    __function__: this.tok.T_FUNC_C,
+    __method__: this.tok.T_METHOD_C,
+    __line__: this.tok.T_LINE,
+    __file__: this.tok.T_FILE,
+    __dir__: this.tok.T_DIR,
+    __namespace__: this.tok.T_NS_C,
+    exit: this.tok.T_EXIT,
+    die: this.tok.T_EXIT,
+    function: this.tok.T_FUNCTION,
+    const: this.tok.T_CONST,
+    return: this.tok.T_RETURN,
+    try: this.tok.T_TRY,
+    catch: this.tok.T_CATCH,
+    finally: this.tok.T_FINALLY,
+    throw: this.tok.T_THROW,
+    if: this.tok.T_IF,
+    elseif: this.tok.T_ELSEIF,
+    endif: this.tok.T_ENDIF,
+    else: this.tok.T_ELSE,
+    while: this.tok.T_WHILE,
+    endwhile: this.tok.T_ENDWHILE,
+    do: this.tok.T_DO,
+    for: this.tok.T_FOR,
+    endfor: this.tok.T_ENDFOR,
+    foreach: this.tok.T_FOREACH,
+    endforeach: this.tok.T_ENDFOREACH,
+    declare: this.tok.T_DECLARE,
+    enddeclare: this.tok.T_ENDDECLARE,
+    instanceof: this.tok.T_INSTANCEOF,
+    as: this.tok.T_AS,
+    switch: this.tok.T_SWITCH,
+    endswitch: this.tok.T_ENDSWITCH,
+    case: this.tok.T_CASE,
+    default: this.tok.T_DEFAULT,
+    break: this.tok.T_BREAK,
+    continue: this.tok.T_CONTINUE,
+    goto: this.tok.T_GOTO,
+    echo: this.tok.T_ECHO,
+    print: this.tok.T_PRINT,
+    class: this.tok.T_CLASS,
+    interface: this.tok.T_INTERFACE,
+    trait: this.tok.T_TRAIT,
+    extends: this.tok.T_EXTENDS,
+    implements: this.tok.T_IMPLEMENTS,
+    new: this.tok.T_NEW,
+    clone: this.tok.T_CLONE,
+    var: this.tok.T_VAR,
+    eval: this.tok.T_EVAL,
+    include: this.tok.T_INCLUDE,
+    include_once: this.tok.T_INCLUDE_ONCE,
+    require: this.tok.T_REQUIRE,
+    require_once: this.tok.T_REQUIRE_ONCE,
+    namespace: this.tok.T_NAMESPACE,
+    use: this.tok.T_USE,
+    insteadof: this.tok.T_INSTEADOF,
+    global: this.tok.T_GLOBAL,
+    isset: this.tok.T_ISSET,
+    empty: this.tok.T_EMPTY,
+    __halt_compiler: this.tok.T_HALT_COMPILER,
+    static: this.tok.T_STATIC,
+    abstract: this.tok.T_ABSTRACT,
+    final: this.tok.T_FINAL,
+    private: this.tok.T_PRIVATE,
+    protected: this.tok.T_PROTECTED,
+    public: this.tok.T_PUBLIC,
+    unset: this.tok.T_UNSET,
+    list: this.tok.T_LIST,
+    array: this.tok.T_ARRAY,
+    callable: this.tok.T_CALLABLE,
+    or: this.tok.T_LOGICAL_OR,
+    and: this.tok.T_LOGICAL_AND,
+    xor: this.tok.T_LOGICAL_XOR
+  };
+  this.castKeywords = {
+    int: this.tok.T_INT_CAST,
+    integer: this.tok.T_INT_CAST,
+    real: this.tok.T_DOUBLE_CAST,
+    double: this.tok.T_DOUBLE_CAST,
+    float: this.tok.T_DOUBLE_CAST,
+    string: this.tok.T_STRING_CAST,
+    binary: this.tok.T_STRING_CAST,
+    array: this.tok.T_ARRAY_CAST,
+    object: this.tok.T_OBJECT_CAST,
+    bool: this.tok.T_BOOL_CAST,
+    boolean: this.tok.T_BOOL_CAST,
+    unset: this.tok.T_UNSET_CAST
+  };
+};
+
+/**
+ * Initialize the lexer with the specified input
+ */
+lexer.prototype.setInput = function(input) {
+  this._input = input;
+  this.size = input.length;
+  this.yylineno = 1;
+  this.offset = 0;
+  this.yyprevcol = 0;
+  this.yytext = "";
+  this.yylloc = {
+    first_offset: 0,
+    first_line: 1,
+    first_column: 0,
+    prev_offset: 0,
+    prev_line: 1,
+    prev_column: 0,
+    last_line: 1,
+    last_column: 0
+  };
+  this.tokens = [];
+  this.done = this.offset >= this.size;
+  if (!this.all_tokens && this.mode_eval) {
+    this.conditionStack = ["INITIAL"];
+    this.begin("ST_IN_SCRIPTING");
+  } else {
+    this.conditionStack = [];
+    this.begin("INITIAL");
+  }
+  return this;
+};
+
+/**
+ * consumes and returns one char from the input
+ */
+lexer.prototype.input = function() {
+  const ch = this._input[this.offset];
+  if (!ch) return "";
+  this.yytext += ch;
+  this.offset++;
+  if (ch === "\r" && this._input[this.offset] === "\n") {
+    this.yytext += "\n";
+    this.offset++;
+  }
+  if (ch === "\n" || ch === "\r") {
+    this.yylloc.last_line = ++this.yylineno;
+    this.yyprevcol = this.yylloc.last_column;
+    this.yylloc.last_column = 0;
+  } else {
+    this.yylloc.last_column++;
+  }
+  return ch;
+};
+
+/**
+ * revert eating specified size
+ */
+lexer.prototype.unput = function(size) {
+  if (size === 1) {
+    // 1 char unput (most cases)
+    this.offset--;
+    if (
+      this._input[this.offset] === "\n" &&
+      this._input[this.offset - 1] === "\r"
+    ) {
+      this.offset--;
+      size++;
+    }
+    if (
+      this._input[this.offset] === "\r" ||
+      this._input[this.offset] === "\n"
+    ) {
+      this.yylloc.last_line--;
+      this.yylineno--;
+      this.yylloc.last_column = this.yyprevcol;
+    } else {
+      this.yylloc.last_column--;
+    }
+    this.yytext = this.yytext.substring(0, this.yytext.length - size);
+  } else if (size > 0) {
+    this.offset -= size;
+    if (size < this.yytext.length) {
+      this.yytext = this.yytext.substring(0, this.yytext.length - size);
+      // re-calculate position
+      this.yylloc.last_line = this.yylloc.first_line;
+      this.yylloc.last_column = this.yyprevcol = this.yylloc.first_column;
+      for (let i = 0; i < this.yytext.length; i++) {
+        let c = this.yytext[i];
+        if (c === "\r") {
+          c = this.yytext[++i];
+          this.yyprevcol = this.yylloc.last_column;
+          this.yylloc.last_line++;
+          this.yylloc.last_column = 0;
+          if (c !== "\n") {
+            if (c === "\r") {
+              this.yylloc.last_line++;
+            } else {
+              this.yylloc.last_column++;
+            }
+          }
+        } else if (c === "\n") {
+          this.yyprevcol = this.yylloc.last_column;
+          this.yylloc.last_line++;
+          this.yylloc.last_column = 0;
+        } else {
+          this.yylloc.last_column++;
+        }
+      }
+      this.yylineno = this.yylloc.last_line;
+    } else {
+      // reset full text
+      this.yytext = "";
+      this.yylloc.last_line = this.yylineno = this.yylloc.first_line;
+      this.yylloc.last_column = this.yylloc.first_column;
+    }
+  }
+
+  return this;
+};
+
+// check if the text matches
+lexer.prototype.tryMatch = function(text) {
+  return text === this.ahead(text.length);
+};
+
+// check if the text matches
+lexer.prototype.tryMatchCaseless = function(text) {
+  return text === this.ahead(text.length).toLowerCase();
+};
+
+// look ahead
+lexer.prototype.ahead = function(size) {
+  let text = this._input.substring(this.offset, this.offset + size);
+  if (
+    text[text.length - 1] === "\r" &&
+    this._input[this.offset + size + 1] === "\n"
+  ) {
+    text += "\n";
+  }
+  return text;
+};
+
+// consume the specified size
+lexer.prototype.consume = function(size) {
+  for (let i = 0; i < size; i++) {
+    const ch = this._input[this.offset];
+    if (!ch) break;
+    this.yytext += ch;
+    this.offset++;
+    if (ch === "\r" && this._input[this.offset] === "\n") {
+      this.yytext += "\n";
+      this.offset++;
+      i++;
+    }
+    if (ch === "\n" || ch === "\r") {
+      this.yylloc.last_line = ++this.yylineno;
+      this.yyprevcol = this.yylloc.last_column;
+      this.yylloc.last_column = 0;
+    } else {
+      this.yylloc.last_column++;
+    }
+  }
+  return this;
+};
+
+/**
+ * Gets the current state
+ */
+lexer.prototype.getState = function() {
+  return {
+    yytext: this.yytext,
+    offset: this.offset,
+    yylineno: this.yylineno,
+    yyprevcol: this.yyprevcol,
+    yylloc: {
+      first_offset: this.yylloc.first_offset,
+      first_line: this.yylloc.first_line,
+      first_column: this.yylloc.first_column,
+      last_line: this.yylloc.last_line,
+      last_column: this.yylloc.last_column
+    }
+  };
+};
+
+/**
+ * Sets the current lexer state
+ */
+lexer.prototype.setState = function(state) {
+  this.yytext = state.yytext;
+  this.offset = state.offset;
+  this.yylineno = state.yylineno;
+  this.yyprevcol = state.yyprevcol;
+  this.yylloc = state.yylloc;
+  return this;
+};
+
+// prepend next token
+lexer.prototype.appendToken = function(value, ahead) {
+  this.tokens.push([value, ahead]);
+  return this;
+};
+
+// return next match that has a token
+lexer.prototype.lex = function() {
+  this.yylloc.prev_offset = this.offset;
+  this.yylloc.prev_line = this.yylloc.last_line;
+  this.yylloc.prev_column = this.yylloc.last_column;
+  let token = this.next() || this.lex();
+  if (!this.all_tokens) {
+    while (
+      token === this.tok.T_WHITESPACE || // ignore white space
+      (!this.comment_tokens &&
+        (token === this.tok.T_COMMENT || // ignore single lines comments
+          token === this.tok.T_DOC_COMMENT)) || // ignore doc comments
+      // ignore open tags
+      token === this.tok.T_OPEN_TAG
+    ) {
+      token = this.next() || this.lex();
+    }
+    if (token == this.tok.T_OPEN_TAG_WITH_ECHO) {
+      // https://github.com/php/php-src/blob/7ff186434e82ee7be7c59d0db9a976641cf7b09c/Zend/zend_compile.c#L1683
+      // open tag with echo statement
+      return this.tok.T_ECHO;
+    } else if (token === this.tok.T_CLOSE_TAG) {
+      // https://github.com/php/php-src/blob/7ff186434e82ee7be7c59d0db9a976641cf7b09c/Zend/zend_compile.c#L1680
+      return ";"; /* implicit ; */
+    }
+  }
+  if (!this.yylloc.prev_offset) {
+    this.yylloc.prev_offset = this.yylloc.first_offset;
+    this.yylloc.prev_line = this.yylloc.first_line;
+    this.yylloc.prev_column = this.yylloc.first_column;
+  }
+  /*else if (this.yylloc.prev_offset === this.offset && this.offset !== this.size) {
+    throw new Error('Infinite loop @ ' + this.offset + ' / ' + this.size);
+  }*/
+  return token;
+};
+
+// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
+lexer.prototype.begin = function(condition) {
+  this.conditionStack.push(condition);
+  this.curCondition = condition;
+  this.stateCb = this["match" + condition];
+  if (typeof this.stateCb !== "function") {
+    throw new Error('Undefined condition state "' + condition + '"');
+  }
+  return this;
+};
+
+// pop the previously active lexer condition state off the condition stack
+lexer.prototype.popState = function() {
+  const n = this.conditionStack.length - 1;
+  const condition = n > 0 ? this.conditionStack.pop() : this.conditionStack[0];
+  this.curCondition = this.conditionStack[this.conditionStack.length - 1];
+  this.stateCb = this["match" + this.curCondition];
+  if (typeof this.stateCb !== "function") {
+    throw new Error('Undefined condition state "' + this.curCondition + '"');
+  }
+  return condition;
+};
+
+// return next match in input
+lexer.prototype.next = function() {
+  let token;
+  if (!this._input) {
+    this.done = true;
+  }
+  this.yylloc.first_offset = this.offset;
+  this.yylloc.first_line = this.yylloc.last_line;
+  this.yylloc.first_column = this.yylloc.last_column;
+  this.yytext = "";
+  if (this.done) {
+    this.yylloc.prev_offset = this.yylloc.first_offset;
+    this.yylloc.prev_line = this.yylloc.first_line;
+    this.yylloc.prev_column = this.yylloc.first_column;
+    return this.EOF;
+  }
+  if (this.tokens.length > 0) {
+    token = this.tokens.shift();
+    if (typeof token[1] === "object") {
+      this.setState(token[1]);
+    } else {
+      this.consume(token[1]);
+    }
+    token = token[0];
+  } else {
+    token = this.stateCb.apply(this, []);
+  }
+  if (this.offset >= this.size && this.tokens.length === 0) {
+    this.done = true;
+  }
+  if (this.debug) {
+    let tName = token;
+    if (typeof tName === "number") {
+      tName = this.engine.tokens.values[tName];
+    } else {
+      tName = '"' + tName + '"';
+    }
+    const e = new Error(
+      tName +
+        "\tfrom " +
+        this.yylloc.first_line +
+        "," +
+        this.yylloc.first_column +
+        "\t - to " +
+        this.yylloc.last_line +
+        "," +
+        this.yylloc.last_column +
+        '\t"' +
+        this.yytext +
+        '"'
+    );
+    // eslint-disable-next-line no-console
+    console.error(e.stack);
+  }
+  return token;
+};
+
+// extends the lexer with states
+[
+  require("./lexer/comments.js"),
+  require("./lexer/initial.js"),
+  require("./lexer/numbers.js"),
+  require("./lexer/property.js"),
+  require("./lexer/scripting.js"),
+  require("./lexer/strings.js"),
+  require("./lexer/tokens.js"),
+  require("./lexer/utils.js")
+].forEach(function(ext) {
+  for (const k in ext) {
+    lexer.prototype[k] = ext[k];
+  }
+});
+
+module.exports = lexer;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/lexer_comments.js.html b/lexer_comments.js.html new file mode 100644 index 000000000..fa8464ce2 --- /dev/null +++ b/lexer_comments.js.html @@ -0,0 +1,202 @@ + + + + + + + + + + + lexer/comments.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ lexer/comments.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * Reads a single line comment
+   */
+  T_COMMENT: function() {
+    while (this.offset < this.size) {
+      const ch = this.input();
+      if (ch === "\n" || ch === "\r") {
+        return this.tok.T_COMMENT;
+      } else if (
+        ch === "?" &&
+        !this.aspTagMode &&
+        this._input[this.offset] === ">"
+      ) {
+        this.unput(1);
+        return this.tok.T_COMMENT;
+      } else if (
+        ch === "%" &&
+        this.aspTagMode &&
+        this._input[this.offset] === ">"
+      ) {
+        this.unput(1);
+        return this.tok.T_COMMENT;
+      }
+    }
+    return this.tok.T_COMMENT;
+  },
+  /**
+   * Behaviour : https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1927
+   */
+  T_DOC_COMMENT: function() {
+    let ch = this.input();
+    let token = this.tok.T_COMMENT;
+    if (ch === "*") {
+      // started with '/*' , check is next is '*'
+      ch = this.input();
+      if (this.is_WHITESPACE()) {
+        // check if next is WHITESPACE
+        token = this.tok.T_DOC_COMMENT;
+      }
+      if (ch === "/") {
+        return token;
+      } else {
+        this.unput(1); // reset
+      }
+    }
+    while (this.offset < this.size) {
+      ch = this.input();
+      if (ch === "*" && this._input[this.offset] === "/") {
+        this.input();
+        break;
+      }
+    }
+    return token;
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/lexer_strings.js.html b/lexer_strings.js.html new file mode 100644 index 000000000..cc605aef5 --- /dev/null +++ b/lexer_strings.js.html @@ -0,0 +1,556 @@ + + + + + + + + + + + lexer/strings.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ lexer/strings.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  T_CONSTANT_ENCAPSED_STRING: function() {
+    let ch;
+    while (this.offset < this.size) {
+      ch = this.input();
+      if (ch == "\\") {
+        this.input();
+      } else if (ch == "'") {
+        break;
+      }
+    }
+    return this.tok.T_CONSTANT_ENCAPSED_STRING;
+  },
+  // check if matching a HEREDOC state
+  is_HEREDOC: function() {
+    const revert = this.offset;
+    if (
+      this._input[this.offset - 1] === "<" &&
+      this._input[this.offset] === "<" &&
+      this._input[this.offset + 1] === "<"
+    ) {
+      this.offset += 3;
+
+      // optional tabs / spaces
+      if (this.is_TABSPACE()) {
+        while (this.offset < this.size) {
+          this.offset++;
+          if (!this.is_TABSPACE()) {
+            break;
+          }
+        }
+      }
+
+      // optional quotes
+      let tChar = this._input[this.offset - 1];
+      if (tChar === "'" || tChar === '"') {
+        this.offset++;
+      } else {
+        tChar = null;
+      }
+
+      // required label
+      if (this.is_LABEL_START()) {
+        let yyoffset = this.offset - 1;
+        while (this.offset < this.size) {
+          this.offset++;
+          if (!this.is_LABEL()) {
+            break;
+          }
+        }
+        const yylabel = this._input.substring(yyoffset, this.offset - 1);
+        if (!tChar || tChar === this._input[this.offset - 1]) {
+          // required ending quote
+          if (tChar) this.offset++;
+          // require newline
+          if (
+            this._input[this.offset - 1] === "\r" ||
+            this._input[this.offset - 1] === "\n"
+          ) {
+            // go go go
+            this.heredoc_label = yylabel;
+            yyoffset = this.offset - revert;
+            this.offset = revert;
+            this.consume(yyoffset);
+            if (tChar === "'") {
+              this.begin("ST_NOWDOC");
+            } else {
+              this.begin("ST_HEREDOC");
+            }
+            return this.tok.T_START_HEREDOC;
+          }
+        }
+      }
+    }
+    this.offset = revert;
+    return false;
+  },
+  ST_DOUBLE_QUOTES: function() {
+    let ch;
+    while (this.offset < this.size) {
+      ch = this.input();
+      if (ch == "\\") {
+        this.input();
+      } else if (ch == '"') {
+        break;
+      } else if (ch == "$") {
+        ch = this.input();
+        if (ch == "{" || this.is_LABEL_START()) {
+          this.unput(2);
+          break;
+        }
+        if (ch) this.unput(1);
+      } else if (ch == "{") {
+        ch = this.input();
+        if (ch == "$") {
+          this.unput(2);
+          break;
+        }
+        if (ch) this.unput(1);
+      }
+    }
+    if (ch == '"') {
+      return this.tok.T_CONSTANT_ENCAPSED_STRING;
+    } else {
+      let prefix = 1;
+      if (this.yytext[0] === "b" || this.yytext[0] === "B") {
+        prefix = 2;
+      }
+      if (this.yytext.length > 2) {
+        this.appendToken(
+          this.tok.T_ENCAPSED_AND_WHITESPACE,
+          this.yytext.length - prefix
+        );
+      }
+      this.unput(this.yytext.length - prefix);
+      this.begin("ST_DOUBLE_QUOTES");
+      return this.yytext;
+    }
+  },
+
+  // check if its a DOC end sequence
+  isDOC_MATCH: function() {
+    // @fixme : check if out of text limits
+    if (
+      this._input.substring(
+        this.offset - 1,
+        this.offset - 1 + this.heredoc_label.length
+      ) === this.heredoc_label
+    ) {
+      const ch = this._input[this.offset - 1 + this.heredoc_label.length];
+      if (ch === "\n" || ch === "\r" || ch === ";") {
+        return true;
+      }
+    }
+    return false;
+  },
+
+  matchST_NOWDOC: function() {
+    /** edge case : empty now doc **/
+    if (this.isDOC_MATCH()) {
+      // @fixme : never reached (may be caused by quotes)
+      this.consume(this.heredoc_label.length);
+      this.popState();
+      return this.tok.T_END_HEREDOC;
+    }
+    /** SCANNING CONTENTS **/
+    let ch = this._input[this.offset - 1];
+    while (this.offset < this.size) {
+      if (ch === "\n" || ch === "\r") {
+        ch = this.input();
+        if (this.isDOC_MATCH()) {
+          this.unput(1).popState();
+          this.appendToken(this.tok.T_END_HEREDOC, this.heredoc_label.length);
+          return this.tok.T_ENCAPSED_AND_WHITESPACE;
+        }
+      } else {
+        ch = this.input();
+      }
+    }
+    // too bad ! reached end of document (will get a parse error)
+    return this.tok.T_ENCAPSED_AND_WHITESPACE;
+  },
+
+  matchST_HEREDOC: function() {
+    /** edge case : empty here doc **/
+    let ch = this.input();
+    if (this.isDOC_MATCH()) {
+      this.consume(this.heredoc_label.length - 1);
+      this.popState();
+      return this.tok.T_END_HEREDOC;
+    }
+    /** SCANNING CONTENTS **/
+    while (this.offset < this.size) {
+      if (ch === "\\") {
+        ch = this.input(); // ignore next
+        if (ch !== "\n" && ch !== "\r") {
+          ch = this.input();
+        }
+      }
+
+      if (ch === "\n" || ch === "\r") {
+        ch = this.input();
+        if (this.isDOC_MATCH()) {
+          this.unput(1).popState();
+          this.appendToken(this.tok.T_END_HEREDOC, this.heredoc_label.length);
+          return this.tok.T_ENCAPSED_AND_WHITESPACE;
+        }
+      } else if (ch === "$") {
+        ch = this.input();
+        if (ch === "{") {
+          // start of ${
+          this.begin("ST_LOOKING_FOR_VARNAME");
+          if (this.yytext.length > 2) {
+            this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES, 2);
+            this.unput(2);
+            return this.tok.T_ENCAPSED_AND_WHITESPACE;
+          } else {
+            return this.tok.T_DOLLAR_OPEN_CURLY_BRACES;
+          }
+        } else if (this.is_LABEL_START()) {
+          // start of $var...
+          const yyoffset = this.offset;
+          const next = this.consume_VARIABLE();
+          if (this.yytext.length > this.offset - yyoffset + 2) {
+            this.appendToken(next, this.offset - yyoffset + 2);
+            this.unput(this.offset - yyoffset + 2);
+            return this.tok.T_ENCAPSED_AND_WHITESPACE;
+          } else {
+            return next;
+          }
+          //console.log(this.yytext);
+        }
+      } else if (ch === "{") {
+        ch = this.input();
+        if (ch === "$") {
+          // start of {$...
+          this.begin("ST_IN_SCRIPTING");
+          if (this.yytext.length > 2) {
+            this.appendToken(this.tok.T_CURLY_OPEN, 1);
+            this.unput(2);
+            return this.tok.T_ENCAPSED_AND_WHITESPACE;
+          } else {
+            this.unput(1);
+            return this.tok.T_CURLY_OPEN;
+          }
+        }
+      } else {
+        ch = this.input();
+      }
+    }
+
+    // too bad ! reached end of document (will get a parse error)
+    return this.tok.T_ENCAPSED_AND_WHITESPACE;
+  },
+
+  consume_VARIABLE: function() {
+    this.consume_LABEL();
+    const ch = this.input();
+    if (ch == "[") {
+      this.unput(1);
+      this.begin("ST_VAR_OFFSET");
+      return this.tok.T_VARIABLE;
+    } else if (ch === "-") {
+      if (this.input() === ">") {
+        this.input();
+        if (this.is_LABEL_START()) {
+          this.begin("ST_LOOKING_FOR_PROPERTY");
+        }
+        this.unput(3);
+        return this.tok.T_VARIABLE;
+      } else {
+        this.unput(2);
+      }
+    } else {
+      if (ch) this.unput(1);
+    }
+    return this.tok.T_VARIABLE;
+  },
+  // HANDLES BACKQUOTES
+  matchST_BACKQUOTE: function() {
+    let ch = this.input();
+    if (ch === "$") {
+      ch = this.input();
+      if (ch === "{") {
+        this.begin("ST_LOOKING_FOR_VARNAME");
+        return this.tok.T_DOLLAR_OPEN_CURLY_BRACES;
+      } else if (this.is_LABEL_START()) {
+        const tok = this.consume_VARIABLE();
+        return tok;
+      }
+    } else if (ch === "{") {
+      if (this._input[this.offset] === "$") {
+        this.begin("ST_IN_SCRIPTING");
+        return this.tok.T_CURLY_OPEN;
+      }
+    } else if (ch === "`") {
+      this.popState();
+      return "`";
+    }
+
+    // any char
+    while (this.offset < this.size) {
+      if (ch === "\\") {
+        this.input();
+      } else if (ch === "`") {
+        this.unput(1);
+        this.popState();
+        this.appendToken("`", 1);
+        break;
+      } else if (ch === "$") {
+        ch = this.input();
+        if (ch === "{") {
+          this.begin("ST_LOOKING_FOR_VARNAME");
+          if (this.yytext.length > 2) {
+            this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES, 2);
+            this.unput(2);
+            return this.tok.T_ENCAPSED_AND_WHITESPACE;
+          } else {
+            return this.tok.T_DOLLAR_OPEN_CURLY_BRACES;
+          }
+        } else if (this.is_LABEL_START()) {
+          // start of $var...
+          const yyoffset = this.offset;
+          const next = this.consume_VARIABLE();
+          if (this.yytext.length > this.offset - yyoffset + 2) {
+            this.appendToken(next, this.offset - yyoffset + 2);
+            this.unput(this.offset - yyoffset + 2);
+            return this.tok.T_ENCAPSED_AND_WHITESPACE;
+          } else {
+            return next;
+          }
+        }
+        continue;
+      } else if (ch === "{") {
+        ch = this.input();
+        if (ch === "$") {
+          // start of {$...
+          this.begin("ST_IN_SCRIPTING");
+          if (this.yytext.length > 2) {
+            this.appendToken(this.tok.T_CURLY_OPEN, 1);
+            this.unput(2);
+            return this.tok.T_ENCAPSED_AND_WHITESPACE;
+          } else {
+            this.unput(1);
+            return this.tok.T_CURLY_OPEN;
+          }
+        }
+        continue;
+      }
+      ch = this.input();
+    }
+    return this.tok.T_ENCAPSED_AND_WHITESPACE;
+  },
+
+  matchST_DOUBLE_QUOTES: function() {
+    let ch = this.input();
+    if (ch === "$") {
+      ch = this.input();
+      if (ch === "{") {
+        this.begin("ST_LOOKING_FOR_VARNAME");
+        return this.tok.T_DOLLAR_OPEN_CURLY_BRACES;
+      } else if (this.is_LABEL_START()) {
+        const tok = this.consume_VARIABLE();
+        return tok;
+      }
+    } else if (ch === "{") {
+      if (this._input[this.offset] === "$") {
+        this.begin("ST_IN_SCRIPTING");
+        return this.tok.T_CURLY_OPEN;
+      }
+    } else if (ch === '"') {
+      this.popState();
+      return '"';
+    }
+
+    // any char
+    while (this.offset < this.size) {
+      if (ch === "\\") {
+        this.input();
+      } else if (ch === '"') {
+        this.unput(1);
+        this.popState();
+        this.appendToken('"', 1);
+        break;
+      } else if (ch === "$") {
+        ch = this.input();
+        if (ch === "{") {
+          this.begin("ST_LOOKING_FOR_VARNAME");
+          if (this.yytext.length > 2) {
+            this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES, 2);
+            this.unput(2);
+            return this.tok.T_ENCAPSED_AND_WHITESPACE;
+          } else {
+            return this.tok.T_DOLLAR_OPEN_CURLY_BRACES;
+          }
+        } else if (this.is_LABEL_START()) {
+          // start of $var...
+          const yyoffset = this.offset;
+          const next = this.consume_VARIABLE();
+          if (this.yytext.length > this.offset - yyoffset + 2) {
+            this.appendToken(next, this.offset - yyoffset + 2);
+            this.unput(this.offset - yyoffset + 2);
+            return this.tok.T_ENCAPSED_AND_WHITESPACE;
+          } else {
+            return next;
+          }
+        }
+        if (ch) this.unput(1);
+      } else if (ch === "{") {
+        ch = this.input();
+        if (ch === "$") {
+          // start of {$...
+          this.begin("ST_IN_SCRIPTING");
+          if (this.yytext.length > 2) {
+            this.appendToken(this.tok.T_CURLY_OPEN, 1);
+            this.unput(2);
+            return this.tok.T_ENCAPSED_AND_WHITESPACE;
+          } else {
+            // @fixme : yytext = '"{$' (this.yytext.length > 3)
+            this.unput(1);
+            return this.tok.T_CURLY_OPEN;
+          }
+        }
+        if (ch) this.unput(1);
+      }
+      ch = this.input();
+    }
+    return this.tok.T_ENCAPSED_AND_WHITESPACE;
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 69034fc0d..000000000 --- a/package-lock.json +++ /dev/null @@ -1,9623 +0,0 @@ -{ - "name": "php-parser", - "version": "3.0.0-alpha2", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.0.0-beta.46", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.46.tgz", - "integrity": "sha512-7BKRkmYaPZm3Yff5HGZJKCz7RqZ5jUjknsXT6Gz5YKG23J3uq9hAj0epncCB0rlqmnZ8Q+UUpQB2tCR5mT37vw==", - "dev": true, - "requires": { - "@babel/highlight": "7.0.0-beta.46" - } - }, - "@babel/highlight": { - "version": "7.0.0-beta.46", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.46.tgz", - "integrity": "sha512-r4snW6Q8ICL3Y8hGzYJRvyG/+sc+kvkewXNedG9tQjoHmUFMwMSv/o45GWQUQswevGnWghiGkpRPivFfOuMsOA==", - "dev": true, - "requires": { - "chalk": "2.4.1", - "esutils": "2.0.2", - "js-tokens": "3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "@webassemblyjs/ast": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.5.13.tgz", - "integrity": "sha512-49nwvW/Hx9i+OYHg+mRhKZfAlqThr11Dqz8TsrvqGKMhdI2ijy3KBJOun2Z4770TPjrIJhR6KxChQIDaz8clDA==", - "dev": true, - "requires": { - "@webassemblyjs/helper-module-context": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/wast-parser": "1.5.13", - "debug": "3.1.0", - "mamacro": "0.0.3" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.5.13.tgz", - "integrity": "sha512-vrvvB18Kh4uyghSKb0NTv+2WZx871WL2NzwMj61jcq2bXkyhRC+8Q0oD7JGVf0+5i/fKQYQSBCNMMsDMRVAMqA==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.5.13.tgz", - "integrity": "sha512-dBh2CWYqjaDlvMmRP/kudxpdh30uXjIbpkLj9HQe+qtYlwvYjPRjdQXrq1cTAAOUSMTtzqbXIxEdEZmyKfcwsg==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.5.13.tgz", - "integrity": "sha512-v7igWf1mHcpJNbn4m7e77XOAWXCDT76Xe7Is1VQFXc4K5jRcFrl9D0NrqM4XifQ0bXiuTSkTKMYqDxu5MhNljA==", - "dev": true, - "requires": { - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "@webassemblyjs/helper-code-frame": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.5.13.tgz", - "integrity": "sha512-yN6ScQQDFCiAXnVctdVO/J5NQRbwyTbQzsGzEgXsAnrxhjp0xihh+nNHQTMrq5UhOqTb5LykpJAvEv9AT0jnAQ==", - "dev": true, - "requires": { - "@webassemblyjs/wast-printer": "1.5.13" - } - }, - "@webassemblyjs/helper-fsm": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.5.13.tgz", - "integrity": "sha512-hSIKzbXjVMRvy3Jzhgu+vDd/aswJ+UMEnLRCkZDdknZO3Z9e6rp1DAs0tdLItjCFqkz9+0BeOPK/mk3eYvVzZg==", - "dev": true - }, - "@webassemblyjs/helper-module-context": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.5.13.tgz", - "integrity": "sha512-zxJXULGPLB7r+k+wIlvGlXpT4CYppRz8fLUM/xobGHc9Z3T6qlmJD9ySJ2jknuktuuiR9AjnNpKYDECyaiX+QQ==", - "dev": true, - "requires": { - "debug": "3.1.0", - "mamacro": "0.0.3" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.5.13.tgz", - "integrity": "sha512-0n3SoNGLvbJIZPhtMFq0XmmnA/YmQBXaZKQZcW8maGKwLpVcgjNrxpFZHEOLKjXJYVN5Il8vSfG7nRX50Zn+aw==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.5.13.tgz", - "integrity": "sha512-IJ/goicOZ5TT1axZFSnlAtz4m8KEjYr12BNOANAwGFPKXM4byEDaMNXYowHMG0yKV9a397eU/NlibFaLwr1fbw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-buffer": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/wasm-gen": "1.5.13", - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "@webassemblyjs/ieee754": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.5.13.tgz", - "integrity": "sha512-TseswvXEPpG5TCBKoLx9tT7+/GMACjC1ruo09j46ULRZWYm8XHpDWaosOjTnI7kr4SRJFzA6MWoUkAB+YCGKKg==", - "dev": true, - "requires": { - "ieee754": "1.1.11" - } - }, - "@webassemblyjs/leb128": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.5.13.tgz", - "integrity": "sha512-0NRMxrL+GG3eISGZBmLBLAVjphbN8Si15s7jzThaw1UE9e5BY1oH49/+MA1xBzxpf1OW5sf9OrPDOclk9wj2yg==", - "dev": true, - "requires": { - "long": "4.0.0" - }, - "dependencies": { - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", - "dev": true - } - } - }, - "@webassemblyjs/utf8": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.5.13.tgz", - "integrity": "sha512-Ve1ilU2N48Ew0lVGB8FqY7V7hXjaC4+PeZM+vDYxEd+R2iQ0q+Wb3Rw8v0Ri0+rxhoz6gVGsnQNb4FjRiEH/Ng==", - "dev": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.5.13.tgz", - "integrity": "sha512-X7ZNW4+Hga4f2NmqENnHke2V/mGYK/xnybJSIXImt1ulxbCOEs/A+ZK/Km2jgihjyVxp/0z0hwIcxC6PrkWtgw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-buffer": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/helper-wasm-section": "1.5.13", - "@webassemblyjs/wasm-gen": "1.5.13", - "@webassemblyjs/wasm-opt": "1.5.13", - "@webassemblyjs/wasm-parser": "1.5.13", - "@webassemblyjs/wast-printer": "1.5.13", - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.5.13.tgz", - "integrity": "sha512-yfv94Se8R73zmr8GAYzezFHc3lDwE/lBXQddSiIZEKZFuqy7yWtm3KMwA1uGbv5G1WphimJxboXHR80IgX1hQA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/ieee754": "1.5.13", - "@webassemblyjs/leb128": "1.5.13", - "@webassemblyjs/utf8": "1.5.13" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.5.13.tgz", - "integrity": "sha512-IkXSkgzVhQ0QYAdIayuCWMmXSYx0dHGU8Ah/AxJf1gBvstMWVnzJnBwLsXLyD87VSBIcsqkmZ28dVb0mOC3oBg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-buffer": "1.5.13", - "@webassemblyjs/wasm-gen": "1.5.13", - "@webassemblyjs/wasm-parser": "1.5.13", - "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.5.13.tgz", - "integrity": "sha512-XnYoIcu2iqq8/LrtmdnN3T+bRjqYFjRHqWbqK3osD/0r/Fcv4d9ecRzjVtC29ENEuNTK4mQ9yyxCBCbK8S/cpg==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-api-error": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/ieee754": "1.5.13", - "@webassemblyjs/leb128": "1.5.13", - "@webassemblyjs/utf8": "1.5.13" - } - }, - "@webassemblyjs/wast-parser": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.5.13.tgz", - "integrity": "sha512-Lbz65T0LQ1LgzKiUytl34CwuhMNhaCLgrh0JW4rJBN6INnBB8NMwUfQM+FxTnLY9qJ+lHJL/gCM5xYhB9oWi4A==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/floating-point-hex-parser": "1.5.13", - "@webassemblyjs/helper-api-error": "1.5.13", - "@webassemblyjs/helper-code-frame": "1.5.13", - "@webassemblyjs/helper-fsm": "1.5.13", - "long": "3.2.0", - "mamacro": "0.0.3" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.5.13.tgz", - "integrity": "sha512-QcwogrdqcBh8Z+eUF8SG+ag5iwQSXxQJELBEHmLkk790wgQgnIMmntT2sMAMw53GiFNckArf5X0bsCA44j3lWQ==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/wast-parser": "1.5.13", - "long": "3.2.0" - } - }, - "abab": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", - "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", - "dev": true - }, - "acorn-dynamic-import": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", - "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", - "dev": true, - "requires": { - "acorn": "5.7.1" - }, - "dependencies": { - "acorn": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", - "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", - "dev": true - } - } - }, - "acorn-globals": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz", - "integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", - "dev": true, - "requires": { - "acorn": "5.5.3" - }, - "dependencies": { - "acorn": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", - "dev": true - } - } - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" - } - }, - "ajv-keywords": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", - "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", - "dev": true - }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" - } - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, - "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "append-transform": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", - "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", - "dev": true, - "requires": { - "default-require-extensions": "1.0.0" - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "1.0.3" - } - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "1.1.0" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", - "dev": true - }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" - } - }, - "assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", - "dev": true, - "requires": { - "util": "0.10.3" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, - "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", - "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", - "dev": true - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" - } - }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "dev": true, - "requires": { - "babel-code-frame": "6.26.0", - "babel-generator": "6.26.1", - "babel-helpers": "6.24.1", - "babel-messages": "6.23.0", - "babel-register": "6.26.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "convert-source-map": "1.5.1", - "debug": "2.6.9", - "json5": "0.5.1", - "lodash": "4.17.10", - "minimatch": "3.0.4", - "path-is-absolute": "1.0.1", - "private": "0.1.8", - "slash": "1.0.0", - "source-map": "0.5.7" - } - }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", - "dev": true, - "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.10", - "source-map": "0.5.7", - "trim-right": "1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", - "dev": true - } - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", - "dev": true, - "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.10" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", - "dev": true, - "requires": { - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.10" - } - }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", - "dev": true, - "requires": { - "babel-helper-optimise-call-expression": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" - } - }, - "babel-jest": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-22.4.3.tgz", - "integrity": "sha512-BgSjmtl3mW3i+VeVHEr9d2zFSAT66G++pJcHQiUjd00pkW+voYXFctIm/indcqOWWXw5a1nUpR1XWszD9fJ1qg==", - "dev": true, - "requires": { - "babel-plugin-istanbul": "4.1.6", - "babel-preset-jest": "22.4.3" - } - }, - "babel-loader": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.5.tgz", - "integrity": "sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw==", - "dev": true, - "requires": { - "find-cache-dir": "1.0.0", - "loader-utils": "1.1.0", - "mkdirp": "0.5.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-istanbul": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", - "integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==", - "dev": true, - "requires": { - "babel-plugin-syntax-object-rest-spread": "6.13.0", - "find-up": "2.1.0", - "istanbul-lib-instrument": "1.10.1", - "test-exclude": "4.2.1" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "2.0.0" - } - } - } - }, - "babel-plugin-jest-hoist": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.3.tgz", - "integrity": "sha512-zhvv4f6OTWy2bYevcJftwGCWXMFe7pqoz41IhMi4xna7xNsX5NygdagsrE0y6kkfuXq8UalwvPwKTyAxME2E/g==", - "dev": true - }, - "babel-plugin-syntax-object-rest-spread": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", - "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", - "dev": true - }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "lodash": "4.17.10" - } - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", - "dev": true, - "requires": { - "babel-helper-define-map": "6.26.0", - "babel-helper-function-name": "6.24.1", - "babel-helper-optimise-call-expression": "6.24.1", - "babel-helper-replace-supers": "6.24.1", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "dev": true, - "requires": { - "babel-helper-function-name": "6.24.1", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "dev": true, - "requires": { - "babel-plugin-transform-strict-mode": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" - } - }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" - } - }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "dev": true, - "requires": { - "babel-helper-replace-supers": "6.24.1", - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "dev": true, - "requires": { - "babel-helper-call-delegate": "6.24.1", - "babel-helper-get-function-arity": "6.24.1", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "dev": true, - "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "dev": true, - "requires": { - "babel-helper-regex": "6.26.0", - "babel-runtime": "6.26.0", - "regexpu-core": "2.0.0" - } - }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", - "dev": true, - "requires": { - "regenerator-transform": "0.10.1" - } - }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0" - } - }, - "babel-preset-es2015": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", - "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", - "babel-plugin-transform-es2015-block-scoping": "6.26.0", - "babel-plugin-transform-es2015-classes": "6.24.1", - "babel-plugin-transform-es2015-computed-properties": "6.24.1", - "babel-plugin-transform-es2015-destructuring": "6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", - "babel-plugin-transform-es2015-for-of": "6.23.0", - "babel-plugin-transform-es2015-function-name": "6.24.1", - "babel-plugin-transform-es2015-literals": "6.22.0", - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", - "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", - "babel-plugin-transform-es2015-modules-umd": "6.24.1", - "babel-plugin-transform-es2015-object-super": "6.24.1", - "babel-plugin-transform-es2015-parameters": "6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", - "babel-plugin-transform-es2015-spread": "6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "6.24.1", - "babel-plugin-transform-es2015-template-literals": "6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "babel-plugin-transform-regenerator": "6.26.0" - } - }, - "babel-preset-jest": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-22.4.3.tgz", - "integrity": "sha512-a+M3LTEXTq3gxv0uBN9Qm6ahUl7a8pj923nFbCUdqFUSsf3YrX8Uc+C3MEwji5Af3LiQjSC7w4ooYewlz8HRTA==", - "dev": true, - "requires": { - "babel-plugin-jest-hoist": "22.4.3", - "babel-plugin-syntax-object-rest-spread": "6.13.0" - } - }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", - "dev": true, - "requires": { - "babel-core": "6.26.3", - "babel-runtime": "6.26.0", - "core-js": "2.5.5", - "home-or-tmp": "2.0.0", - "lodash": "4.17.10", - "mkdirp": "0.5.1", - "source-map-support": "0.4.18" - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, - "requires": { - "core-js": "2.5.5", - "regenerator-runtime": "0.11.1" - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "lodash": "4.17.10" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "dev": true, - "requires": { - "babel-code-frame": "6.26.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "debug": "2.6.9", - "globals": "9.18.0", - "invariant": "2.2.4", - "lodash": "4.17.10" - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "esutils": "2.0.2", - "lodash": "4.17.10", - "to-fast-properties": "1.0.3" - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", - "dev": true - }, - "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", - "dev": true - }, - "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", - "dev": true - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true - }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "dev": true, - "requires": { - "hoek": "4.2.1" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browser-process-hrtime": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", - "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=", - "dev": true - }, - "browser-resolve": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", - "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", - "dev": true, - "requires": { - "resolve": "1.1.7" - } - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "1.0.3", - "cipher-base": "1.0.4", - "create-hash": "1.2.0", - "evp_bytestokey": "1.0.3", - "inherits": "2.0.3", - "safe-buffer": "5.1.2" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "1.2.0", - "browserify-des": "1.0.1", - "evp_bytestokey": "1.0.3" - } - }, - "browserify-des": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.1.tgz", - "integrity": "sha512-zy0Cobe3hhgpiOM32Tj7KQ3Vl91m0njwsjzZQK1L+JDf11dzP9qIvjreVinsvXrgfjhStXwUWAEpB9D7Gwmayw==", - "dev": true, - "requires": { - "cipher-base": "1.0.4", - "des.js": "1.0.0", - "inherits": "2.0.3" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "randombytes": "2.0.6" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "elliptic": "6.4.0", - "inherits": "2.0.3", - "parse-asn1": "5.1.1" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "1.0.6" - } - }, - "bser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", - "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", - "dev": true, - "requires": { - "node-int64": "0.4.0" - } - }, - "buffer-from": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", - "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "cacache": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", - "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", - "dev": true, - "requires": { - "bluebird": "3.5.1", - "chownr": "1.0.1", - "glob": "7.1.2", - "graceful-fs": "4.1.11", - "lru-cache": "4.1.2", - "mississippi": "2.0.0", - "mkdirp": "0.5.1", - "move-concurrently": "1.0.1", - "promise-inflight": "1.0.1", - "rimraf": "2.6.2", - "ssri": "5.3.0", - "unique-filename": "1.1.0", - "y18n": "4.0.0" - }, - "dependencies": { - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "7.1.2" - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "callsites": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "catharsis": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", - "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", - "dev": true, - "requires": { - "underscore-contrib": "0.3.0" - } - }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "optional": true, - "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" - } - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "chardet": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.5.0.tgz", - "integrity": "sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g==", - "dev": true - }, - "chownr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", - "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", - "dev": true - }, - "chrome-trace-event": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz", - "integrity": "sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A==", - "dev": true, - "requires": { - "tslib": "1.9.3" - } - }, - "ci-info": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", - "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.2" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "2.0.0" - } - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "optional": true, - "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" - } - }, - "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "compare-versions": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.1.0.tgz", - "integrity": "sha512-4hAxDSBypT/yp2ySFD346So6Ragw5xmBn/e/agIGl3bZr6DLUqnoRZPusxKrXdYRZpgexO9daejmIenlq/wrIQ==", - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "1.0.0", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" - } - }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "0.1.4" - } - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "convert-source-map": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", - "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", - "dev": true - }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "1.2.0", - "fs-write-stream-atomic": "1.0.10", - "iferr": "0.1.5", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "run-queue": "1.0.3" - }, - "dependencies": { - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "7.0.6" - } - } - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-js": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz", - "integrity": "sha1-sU3ek2xkDAV5prUMq8wTLdYSfjs=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "coveralls": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.0.tgz", - "integrity": "sha512-ZppXR9y5PraUOrf/DzHJY6gzNUhXYE3b9D43xEXs4QYZ7/Oe0Gy0CS+IPKWFfvQFXB3RG9QduaQUFehzSpGAFw==", - "dev": true, - "requires": { - "js-yaml": "3.11.0", - "lcov-parse": "0.0.10", - "log-driver": "1.2.7", - "minimist": "1.2.0", - "request": "2.85.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "create-ecdh": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.1.tgz", - "integrity": "sha512-iZvCCg8XqHQZ1ioNBTzXS/cQSkqkqcPs8xSX4upNB+DAk9Ht3uzQf2J32uAHNCne8LDmKr29AgZrEs4oIrwLuQ==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.0" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "1.0.4", - "inherits": "2.0.3", - "md5.js": "1.3.4", - "ripemd160": "2.0.2", - "sha.js": "2.4.11" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "1.0.4", - "create-hash": "1.2.0", - "inherits": "2.0.3", - "ripemd160": "2.0.2", - "safe-buffer": "5.1.2", - "sha.js": "2.4.11" - } - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "4.1.2", - "shebang-command": "1.2.0", - "which": "1.2.14" - } - }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "dev": true, - "requires": { - "boom": "5.2.0" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "dev": true, - "requires": { - "hoek": "4.2.1" - } - } - } - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "1.0.1", - "browserify-sign": "4.0.4", - "create-ecdh": "4.0.1", - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "diffie-hellman": "5.0.3", - "inherits": "2.0.3", - "pbkdf2": "3.0.16", - "public-encrypt": "4.0.2", - "randombytes": "2.0.6", - "randomfill": "1.0.4" - } - }, - "cssom": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", - "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", - "dev": true - }, - "cssstyle": { - "version": "0.2.37", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", - "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", - "dev": true, - "requires": { - "cssom": "0.3.2" - } - }, - "cyclist": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", - "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", - "dev": true - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "1.0.0" - } - }, - "data-urls": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.0.0.tgz", - "integrity": "sha512-ai40PPQR0Fn1lD2PPie79CibnlMN2AYiDhwFX/rZHVsxbs5kNJSjegqXIprhouGXlRdEnfybva7kqRGnB6mypA==", - "dev": true, - "requires": { - "abab": "1.0.4", - "whatwg-mimetype": "2.1.0", - "whatwg-url": "6.4.1" - } - }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "default-require-extensions": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", - "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", - "dev": true, - "requires": { - "strip-bom": "2.0.0" - } - }, - "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", - "dev": true, - "requires": { - "foreach": "2.0.5", - "object-keys": "1.0.11" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" - } - }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, - "requires": { - "repeating": "2.0.1" - } - }, - "detect-newline": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "miller-rabin": "4.0.1", - "randombytes": "2.0.6" - } - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "requires": { - "webidl-conversions": "4.0.2" - } - }, - "duplexify": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz", - "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==", - "dev": true, - "requires": { - "end-of-stream": "1.4.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "stream-shift": "1.0.0" - } - }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "elliptic": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", - "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0", - "hash.js": "1.1.3", - "hmac-drbg": "1.0.1", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" - } - }, - "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", - "dev": true - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, - "requires": { - "once": "1.4.0" - } - }, - "enhanced-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", - "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "memory-fs": "0.4.1", - "tapable": "1.0.0" - } - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "dev": true, - "requires": { - "prr": "1.0.1" - } - }, - "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", - "dev": true, - "requires": { - "is-arrayish": "0.2.1" - } - }, - "es-abstract": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz", - "integrity": "sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA==", - "dev": true, - "requires": { - "es-to-primitive": "1.1.1", - "function-bind": "1.1.1", - "has": "1.0.1", - "is-callable": "1.1.3", - "is-regex": "1.0.4" - } - }, - "es-to-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", - "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", - "dev": true, - "requires": { - "is-callable": "1.1.3", - "is-date-object": "1.0.1", - "is-symbol": "1.0.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", - "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", - "dev": true, - "requires": { - "esprima": "3.1.3", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.6.1" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, - "eslint-plugin-prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz", - "integrity": "sha512-tGek5clmW5swrAx1mdPYM8oThrBE83ePh7LeseZHBWfHVGrHPhKn7Y5zgRMbU/9D5Td9K4CEmUPjGxA7iw98Og==", - "dev": true, - "requires": { - "fast-diff": "1.1.2", - "jest-docblock": "21.2.0" - }, - "dependencies": { - "jest-docblock": { - "version": "21.2.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-21.2.0.tgz", - "integrity": "sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw==", - "dev": true - } - } - }, - "eslint-scope": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", - "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", - "dev": true, - "requires": { - "esrecurse": "4.2.1", - "estraverse": "4.2.0" - } - }, - "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", - "dev": true - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "4.2.0" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "1.3.4", - "safe-buffer": "5.1.2" - } - }, - "exec-sh": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.1.tgz", - "integrity": "sha512-aLt95pexaugVtQerpmE51+4QfWrNc304uez7jvj6fWnN8GeEHpttB8F36n8N7uVhUMbH/1enbxQ9HImZ4w/9qg==", - "dev": true, - "requires": { - "merge": "1.2.0" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" - } - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "0.1.1" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "2.2.3" - } - }, - "expect": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/expect/-/expect-22.4.3.tgz", - "integrity": "sha1-1aKdCg4fshU1V8rvJnTUVH6RRnQ=", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "jest-diff": "22.4.3", - "jest-get-type": "22.4.3", - "jest-matcher-utils": "22.4.3", - "jest-message-util": "22.4.3", - "jest-regex-util": "22.4.3" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - } - } - }, - "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", - "dev": true - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "external-editor": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.0.tgz", - "integrity": "sha512-mpkfj0FEdxrIhOC04zk85X7StNtr0yXnG7zCb+8ikO8OJi2jsHh5YGoknNTyXgsbHOf1WOOcVU3kPFWT2WgCkQ==", - "dev": true, - "requires": { - "chardet": "0.5.0", - "iconv-lite": "0.4.23", - "tmp": "0.0.33" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", - "dev": true, - "requires": { - "safer-buffer": "2.1.2" - } - } - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "dev": true - }, - "fast-diff": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", - "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fb-watchman": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", - "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", - "dev": true, - "requires": { - "bser": "2.0.0" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fileset": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", - "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", - "dev": true, - "requires": { - "glob": "7.0.6", - "minimatch": "3.0.4" - } - }, - "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "dev": true, - "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" - } - }, - "find-cache-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", - "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", - "dev": true, - "requires": { - "commondir": "1.0.1", - "make-dir": "1.3.0", - "pkg-dir": "2.0.0" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" - } - }, - "flush-write-stream": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", - "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "dev": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.18" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "0.2.2" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" - } - }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "iferr": "0.1.5", - "imurmurhash": "0.1.4", - "readable-stream": "2.3.6" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.3.tgz", - "integrity": "sha512-X+57O5YkDTiEQGiw8i7wYc2nQgweIekqkepI8Q3y4wVlurgBt2SuwxTeYUYMZIGpLZH3r/TsMjczCMXE5ZOt7Q==", - "dev": true, - "optional": true, - "requires": { - "nan": "2.10.0", - "node-pre-gyp": "0.9.1" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.2.4" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "2.1.2" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.1.1", - "yallist": "3.0.2" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.2.4" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.21", - "sax": "1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.9.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.2.0", - "nopt": "4.0.1", - "npm-packlist": "1.1.10", - "npmlog": "4.1.2", - "rc": "1.2.6", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "4.4.1" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.3" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "1.0.1", - "fs-minipass": "1.2.5", - "minipass": "2.2.4", - "minizlib": "1.1.0", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.1", - "yallist": "3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-caller-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "1.0.0" - } - }, - "glob": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "2.0.1" - } - }, - "global-modules-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/global-modules-path/-/global-modules-path-2.1.0.tgz", - "integrity": "sha512-3DrmGj2TP+96cABk9TfMp6f3knH/Y46dqvWznTU3Tf6/bDGLDAn15tFluQ7BcloykOcdY16U0WGq0BQblYOxJQ==", - "dev": true - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", - "dev": true - }, - "handlebars": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", - "dev": true, - "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": "1.0.1" - } - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", - "dev": true, - "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" - } - }, - "has": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", - "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", - "dev": true, - "requires": { - "function-bind": "1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.2" - } - }, - "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" - } - }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "dev": true, - "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.1.0" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "1.1.3", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" - } - }, - "hoek": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", - "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", - "dev": true - }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "dev": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "hosted-git-info": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", - "dev": true - }, - "html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "dev": true, - "requires": { - "whatwg-encoding": "1.0.3" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "ieee754": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.11.tgz", - "integrity": "sha512-VhDzCKN7K8ufStx/CLj5/PDTMgph+qwN5Pkd5i0sGnVwk56zJ0lkT8Qzi1xqWLS0Wp29DgDtNeS7v8/wMoZeHg==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, - "import-local": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", - "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", - "dev": true, - "requires": { - "pkg-dir": "2.0.0", - "resolve-cwd": "2.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "inquirer": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.0.0.tgz", - "integrity": "sha512-tISQWRwtcAgrz+SHPhTH7d3e73k31gsOy6i1csonLc0u1dVK/wYvuOnFeiWqC5OXFIYbmrIFInef31wbT8MEJg==", - "dev": true, - "requires": { - "ansi-escapes": "3.1.0", - "chalk": "2.4.1", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "3.0.0", - "figures": "2.0.0", - "lodash": "4.17.10", - "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rxjs": "6.2.1", - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "through": "2.3.8" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "1.0.5" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "interpret": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", - "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", - "dev": true - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "1.3.1" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "1.11.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "1.1.1" - } - }, - "is-callable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", - "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", - "dev": true - }, - "is-ci": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", - "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", - "dev": true, - "requires": { - "ci-info": "1.1.3" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-generator-fn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", - "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-odd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", - "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", - "dev": true, - "requires": { - "is-number": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "1.0.1" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", - "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istanbul-api": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.1.tgz", - "integrity": "sha512-duj6AlLcsWNwUpfyfHt0nWIeRiZpuShnP40YTxOGQgtaN8fd6JYSxsvxUphTDy8V5MfDXo4s/xVCIIvVCO808g==", - "dev": true, - "requires": { - "async": "2.6.0", - "compare-versions": "3.1.0", - "fileset": "2.0.3", - "istanbul-lib-coverage": "1.2.0", - "istanbul-lib-hook": "1.2.0", - "istanbul-lib-instrument": "1.10.1", - "istanbul-lib-report": "1.1.4", - "istanbul-lib-source-maps": "1.2.4", - "istanbul-reports": "1.3.0", - "js-yaml": "3.11.0", - "mkdirp": "0.5.1", - "once": "1.4.0" - }, - "dependencies": { - "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", - "dev": true, - "requires": { - "lodash": "4.17.10" - } - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "istanbul-lib-source-maps": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.4.tgz", - "integrity": "sha512-UzuK0g1wyQijiaYQxj/CdNycFhAd2TLtO2obKQMTZrZ1jzEMRY3rvpASEKkaxbRR6brvdovfA03znPa/pXcejg==", - "dev": true, - "requires": { - "debug": "3.1.0", - "istanbul-lib-coverage": "1.2.0", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "source-map": "0.5.7" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "7.0.6" - } - } - } - }, - "istanbul-lib-coverage": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", - "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", - "dev": true - }, - "istanbul-lib-hook": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.0.tgz", - "integrity": "sha512-p3En6/oGkFQV55Up8ZPC2oLxvgSxD8CzA0yBrhRZSh3pfv3OFj9aSGVC0yoerAi/O4u7jUVnOGVX1eVFM+0tmQ==", - "dev": true, - "requires": { - "append-transform": "0.4.0" - } - }, - "istanbul-lib-instrument": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz", - "integrity": "sha512-1dYuzkOCbuR5GRJqySuZdsmsNKPL3PTuyPevQfoCXJePT9C8y1ga75neU+Tuy9+yS3G/dgx8wgOmp2KLpgdoeQ==", - "dev": true, - "requires": { - "babel-generator": "6.26.1", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "istanbul-lib-coverage": "1.2.0", - "semver": "5.5.0" - } - }, - "istanbul-lib-report": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz", - "integrity": "sha512-Azqvq5tT0U09nrncK3q82e/Zjkxa4tkFZv7E6VcqP0QCPn6oNljDPfrZEC/umNXds2t7b8sRJfs6Kmpzt8m2kA==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "1.2.0", - "mkdirp": "0.5.1", - "path-parse": "1.0.5", - "supports-color": "3.2.3" - }, - "dependencies": { - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "1.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz", - "integrity": "sha512-fDa0hwU/5sDXwAklXgAoCJCOsFsBplVQ6WBldz5UwaqOzmDhUK4nfuR7/G//G2lERlblUNJB8P6e8cXq3a7MlA==", - "dev": true, - "requires": { - "debug": "3.1.0", - "istanbul-lib-coverage": "1.2.0", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "source-map": "0.5.7" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "7.0.6" - } - } - } - }, - "istanbul-reports": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.3.0.tgz", - "integrity": "sha512-y2Z2IMqE1gefWUaVjrBm0mSKvUkaBy9Vqz8iwr/r40Y9hBbIteH5wqHG/9DLTfJ9xUnUT2j7A3+VVJ6EaYBllA==", - "dev": true, - "requires": { - "handlebars": "4.0.11" - } - }, - "jest": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-22.4.3.tgz", - "integrity": "sha512-FFCdU/pXOEASfHxFDOWUysI/+FFoqiXJADEIXgDKuZyqSmBD3tZ4BEGH7+M79v7czj7bbkhwtd2LaEDcJiM/GQ==", - "dev": true, - "requires": { - "import-local": "1.0.0", - "jest-cli": "22.4.3" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "2.0.0" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "jest-cli": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-22.4.3.tgz", - "integrity": "sha512-IiHybF0DJNqZPsbjn4Cy4vcqcmImpoFwNFnkehzVw8lTUSl4axZh5DHewu5bdpZF2Y5gUqFKYzH0FH4Qx2k+UA==", - "dev": true, - "requires": { - "ansi-escapes": "3.1.0", - "chalk": "2.4.1", - "exit": "0.1.2", - "glob": "7.1.2", - "graceful-fs": "4.1.11", - "import-local": "1.0.0", - "is-ci": "1.1.0", - "istanbul-api": "1.3.1", - "istanbul-lib-coverage": "1.2.0", - "istanbul-lib-instrument": "1.10.1", - "istanbul-lib-source-maps": "1.2.3", - "jest-changed-files": "22.4.3", - "jest-config": "22.4.3", - "jest-environment-jsdom": "22.4.3", - "jest-get-type": "22.4.3", - "jest-haste-map": "22.4.3", - "jest-message-util": "22.4.3", - "jest-regex-util": "22.4.3", - "jest-resolve-dependencies": "22.4.3", - "jest-runner": "22.4.3", - "jest-runtime": "22.4.3", - "jest-snapshot": "22.4.3", - "jest-util": "22.4.3", - "jest-validate": "22.4.3", - "jest-worker": "22.4.3", - "micromatch": "2.3.11", - "node-notifier": "5.2.1", - "realpath-native": "1.0.0", - "rimraf": "2.6.2", - "slash": "1.0.0", - "string-length": "2.0.0", - "strip-ansi": "4.0.0", - "which": "1.2.14", - "yargs": "10.1.2" - } - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "7.1.2" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "yargs": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz", - "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", - "dev": true, - "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "8.1.0" - } - }, - "yargs-parser": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", - "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", - "dev": true, - "requires": { - "camelcase": "4.1.0" - } - } - } - }, - "jest-changed-files": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-22.4.3.tgz", - "integrity": "sha512-83Dh0w1aSkUNFhy5d2dvqWxi/y6weDwVVLU6vmK0cV9VpRxPzhTeGimbsbRDSnEoszhF937M4sDLLeS7Cu/Tmw==", - "dev": true, - "requires": { - "throat": "4.1.0" - } - }, - "jest-config": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-22.4.3.tgz", - "integrity": "sha512-KSg3EOToCgkX+lIvenKY7J8s426h6ahXxaUFJxvGoEk0562Z6inWj1TnKoGycTASwiLD+6kSYFALcjdosq9KIQ==", - "dev": true, - "requires": { - "chalk": "2.4.1", - "glob": "7.1.2", - "jest-environment-jsdom": "22.4.3", - "jest-environment-node": "22.4.3", - "jest-get-type": "22.4.3", - "jest-jasmine2": "22.4.3", - "jest-regex-util": "22.4.3", - "jest-resolve": "22.4.3", - "jest-util": "22.4.3", - "jest-validate": "22.4.3", - "pretty-format": "22.4.3" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "jest-diff": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-22.4.3.tgz", - "integrity": "sha512-/QqGvCDP5oZOF6PebDuLwrB2BMD8ffJv6TAGAdEVuDx1+uEgrHpSFrfrOiMRx2eJ1hgNjlQrOQEHetVwij90KA==", - "dev": true, - "requires": { - "chalk": "2.4.1", - "diff": "3.5.0", - "jest-get-type": "22.4.3", - "pretty-format": "22.4.3" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "jest-docblock": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-22.4.3.tgz", - "integrity": "sha512-uPKBEAw7YrEMcXueMKZXn/rbMxBiSv48fSqy3uEnmgOlQhSX+lthBqHb1fKWNVmFqAp9E/RsSdBfiV31LbzaOg==", - "dev": true, - "requires": { - "detect-newline": "2.1.0" - } - }, - "jest-environment-jsdom": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-22.4.3.tgz", - "integrity": "sha512-FviwfR+VyT3Datf13+ULjIMO5CSeajlayhhYQwpzgunswoaLIPutdbrnfUHEMyJCwvqQFaVtTmn9+Y8WCt6n1w==", - "dev": true, - "requires": { - "jest-mock": "22.4.3", - "jest-util": "22.4.3", - "jsdom": "11.9.0" - } - }, - "jest-environment-node": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-22.4.3.tgz", - "integrity": "sha512-reZl8XF6t/lMEuPWwo9OLfttyC26A5AMgDyEQ6DBgZuyfyeNUzYT8BFo6uxCCP/Av/b7eb9fTi3sIHFPBzmlRA==", - "dev": true, - "requires": { - "jest-mock": "22.4.3", - "jest-util": "22.4.3" - } - }, - "jest-get-type": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", - "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", - "dev": true - }, - "jest-haste-map": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-22.4.3.tgz", - "integrity": "sha512-4Q9fjzuPVwnaqGKDpIsCSoTSnG3cteyk2oNVjBX12HHOaF1oxql+uUiqZb5Ndu7g/vTZfdNwwy4WwYogLh29DQ==", - "dev": true, - "requires": { - "fb-watchman": "2.0.0", - "graceful-fs": "4.1.11", - "jest-docblock": "22.4.3", - "jest-serializer": "22.4.3", - "jest-worker": "22.4.3", - "micromatch": "2.3.11", - "sane": "2.5.0" - } - }, - "jest-jasmine2": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-22.4.3.tgz", - "integrity": "sha512-yZCPCJUcEY6R5KJB/VReo1AYI2b+5Ky+C+JA1v34jndJsRcLpU4IZX4rFJn7yDTtdNbO/nNqg+3SDIPNH2ecnw==", - "dev": true, - "requires": { - "chalk": "2.4.1", - "co": "4.6.0", - "expect": "22.4.3", - "graceful-fs": "4.1.11", - "is-generator-fn": "1.0.0", - "jest-diff": "22.4.3", - "jest-matcher-utils": "22.4.3", - "jest-message-util": "22.4.3", - "jest-snapshot": "22.4.3", - "jest-util": "22.4.3", - "source-map-support": "0.5.5" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.5.tgz", - "integrity": "sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA==", - "dev": true, - "requires": { - "buffer-from": "1.0.0", - "source-map": "0.6.1" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "jest-leak-detector": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-22.4.3.tgz", - "integrity": "sha512-NZpR/Ls7+ndO57LuXROdgCGz2RmUdC541tTImL9bdUtU3WadgFGm0yV+Ok4Fuia/1rLAn5KaJ+i76L6e3zGJYQ==", - "dev": true, - "requires": { - "pretty-format": "22.4.3" - } - }, - "jest-matcher-utils": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-22.4.3.tgz", - "integrity": "sha512-lsEHVaTnKzdAPR5t4B6OcxXo9Vy4K+kRRbG5gtddY8lBEC+Mlpvm1CJcsMESRjzUhzkz568exMV1hTB76nAKbA==", - "dev": true, - "requires": { - "chalk": "2.4.1", - "jest-get-type": "22.4.3", - "pretty-format": "22.4.3" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "jest-message-util": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-22.4.3.tgz", - "integrity": "sha512-iAMeKxhB3Se5xkSjU0NndLLCHtP4n+GtCqV0bISKA5dmOXQfEbdEmYiu2qpnWBDCQdEafNDDU6Q+l6oBMd/+BA==", - "dev": true, - "requires": { - "@babel/code-frame": "7.0.0-beta.46", - "chalk": "2.4.1", - "micromatch": "2.3.11", - "slash": "1.0.0", - "stack-utils": "1.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "jest-mock": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-22.4.3.tgz", - "integrity": "sha512-+4R6mH5M1G4NK16CKg9N1DtCaFmuxhcIqF4lQK/Q1CIotqMs/XBemfpDPeVZBFow6iyUNu6EBT9ugdNOTT5o5Q==", - "dev": true - }, - "jest-regex-util": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-22.4.3.tgz", - "integrity": "sha512-LFg1gWr3QinIjb8j833bq7jtQopiwdAs67OGfkPrvy7uNUbVMfTXXcOKXJaeY5GgjobELkKvKENqq1xrUectWg==", - "dev": true - }, - "jest-resolve": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-22.4.3.tgz", - "integrity": "sha512-u3BkD/MQBmwrOJDzDIaxpyqTxYH+XqAXzVJP51gt29H8jpj3QgKof5GGO2uPGKGeA1yTMlpbMs1gIQ6U4vcRhw==", - "dev": true, - "requires": { - "browser-resolve": "1.11.2", - "chalk": "2.4.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "jest-resolve-dependencies": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-22.4.3.tgz", - "integrity": "sha512-06czCMVToSN8F2U4EvgSB1Bv/56gc7MpCftZ9z9fBgUQM7dzHGCMBsyfVA6dZTx8v0FDcnALf7hupeQxaBCvpA==", - "dev": true, - "requires": { - "jest-regex-util": "22.4.3" - } - }, - "jest-runner": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-22.4.3.tgz", - "integrity": "sha512-U7PLlQPRlWNbvOHWOrrVay9sqhBJmiKeAdKIkvX4n1G2tsvzLlf77nBD28GL1N6tGv4RmuTfI8R8JrkvCa+IBg==", - "dev": true, - "requires": { - "exit": "0.1.2", - "jest-config": "22.4.3", - "jest-docblock": "22.4.3", - "jest-haste-map": "22.4.3", - "jest-jasmine2": "22.4.3", - "jest-leak-detector": "22.4.3", - "jest-message-util": "22.4.3", - "jest-runtime": "22.4.3", - "jest-util": "22.4.3", - "jest-worker": "22.4.3", - "throat": "4.1.0" - } - }, - "jest-runtime": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-22.4.3.tgz", - "integrity": "sha512-Eat/esQjevhx9BgJEC8udye+FfoJ2qvxAZfOAWshYGS22HydHn5BgsvPdTtt9cp0fSl5LxYOFA1Pja9Iz2Zt8g==", - "dev": true, - "requires": { - "babel-core": "6.26.3", - "babel-jest": "22.4.3", - "babel-plugin-istanbul": "4.1.6", - "chalk": "2.4.1", - "convert-source-map": "1.5.1", - "exit": "0.1.2", - "graceful-fs": "4.1.11", - "jest-config": "22.4.3", - "jest-haste-map": "22.4.3", - "jest-regex-util": "22.4.3", - "jest-resolve": "22.4.3", - "jest-util": "22.4.3", - "jest-validate": "22.4.3", - "json-stable-stringify": "1.0.1", - "micromatch": "2.3.11", - "realpath-native": "1.0.0", - "slash": "1.0.0", - "strip-bom": "3.0.0", - "write-file-atomic": "2.3.0", - "yargs": "10.1.2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "2.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "yargs": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz", - "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", - "dev": true, - "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "8.1.0" - } - }, - "yargs-parser": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", - "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", - "dev": true, - "requires": { - "camelcase": "4.1.0" - } - } - } - }, - "jest-serializer": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-22.4.3.tgz", - "integrity": "sha512-uPaUAppx4VUfJ0QDerpNdF43F68eqKWCzzhUlKNDsUPhjOon7ZehR4C809GCqh765FoMRtTVUVnGvIoskkYHiw==", - "dev": true - }, - "jest-snapshot": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-22.4.3.tgz", - "integrity": "sha512-JXA0gVs5YL0HtLDCGa9YxcmmV2LZbwJ+0MfyXBBc5qpgkEYITQFJP7XNhcHFbUvRiniRpRbGVfJrOoYhhGE0RQ==", - "dev": true, - "requires": { - "chalk": "2.4.1", - "jest-diff": "22.4.3", - "jest-matcher-utils": "22.4.3", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "pretty-format": "22.4.3" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "jest-util": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-22.4.3.tgz", - "integrity": "sha512-rfDfG8wyC5pDPNdcnAlZgwKnzHvZDu8Td2NJI/jAGKEGxJPYiE4F0ss/gSAkG4778Y23Hvbz+0GMrDJTeo7RjQ==", - "dev": true, - "requires": { - "callsites": "2.0.0", - "chalk": "2.4.1", - "graceful-fs": "4.1.11", - "is-ci": "1.1.0", - "jest-message-util": "22.4.3", - "mkdirp": "0.5.1", - "source-map": "0.6.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "jest-validate": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-22.4.3.tgz", - "integrity": "sha512-CfFM18W3GSP/xgmA4UouIx0ljdtfD2mjeBC6c89Gg17E44D4tQhAcTrZmf9djvipwU30kSTnk6CzcxdCCeSXfA==", - "dev": true, - "requires": { - "chalk": "2.4.1", - "jest-config": "22.4.3", - "jest-get-type": "22.4.3", - "leven": "2.1.0", - "pretty-format": "22.4.3" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "jest-worker": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-22.4.3.tgz", - "integrity": "sha512-B1ucW4fI8qVAuZmicFxI1R3kr2fNeYJyvIQ1rKcuLYnenFV5K5aMbxFj6J0i00Ju83S8jP2d7Dz14+AvbIHRYQ==", - "dev": true, - "requires": { - "merge-stream": "1.0.1" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", - "dev": true, - "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" - } - }, - "js2xmlparser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", - "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", - "dev": true, - "requires": { - "xmlcreate": "1.0.2" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true - }, - "jsdoc": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", - "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", - "dev": true, - "requires": { - "babylon": "7.0.0-beta.19", - "bluebird": "3.5.1", - "catharsis": "0.8.9", - "escape-string-regexp": "1.0.5", - "js2xmlparser": "3.0.0", - "klaw": "2.0.0", - "marked": "0.3.19", - "mkdirp": "0.5.1", - "requizzle": "0.2.1", - "strip-json-comments": "2.0.1", - "taffydb": "2.6.2", - "underscore": "1.8.3" - }, - "dependencies": { - "babylon": { - "version": "7.0.0-beta.19", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", - "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", - "dev": true - }, - "klaw": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", - "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11" - } - }, - "taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", - "dev": true - } - } - }, - "jsdoc-template": { - "version": "github:braintree/jsdoc-template#9ac837f2a774610c3de55431454777ae2419ba11", - "dev": true - }, - "jsdom": { - "version": "11.9.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.9.0.tgz", - "integrity": "sha512-sb3omwJTJ+HwAltLZevM/KQBusY+l2Ar5UfnTCWk9oUVBiDnQPBNiG1BaTAKttCnneonYbNo7vi4EFDY2lBfNA==", - "dev": true, - "requires": { - "abab": "1.0.4", - "acorn": "5.5.3", - "acorn-globals": "4.1.0", - "array-equal": "1.0.0", - "cssom": "0.3.2", - "cssstyle": "0.2.37", - "data-urls": "1.0.0", - "domexception": "1.0.1", - "escodegen": "1.9.1", - "html-encoding-sniffer": "1.0.2", - "left-pad": "1.3.0", - "nwmatcher": "1.4.4", - "parse5": "4.0.0", - "pn": "1.1.0", - "request": "2.85.0", - "request-promise-native": "1.0.5", - "sax": "1.2.4", - "symbol-tree": "3.2.2", - "tough-cookie": "2.3.4", - "w3c-hr-time": "1.0.1", - "webidl-conversions": "4.0.2", - "whatwg-encoding": "1.0.3", - "whatwg-mimetype": "2.1.0", - "whatwg-url": "6.4.1", - "ws": "4.1.0", - "xml-name-validator": "3.0.0" - }, - "dependencies": { - "acorn": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", - "dev": true - } - } - }, - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, - "optional": true - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "1.0.0" - } - }, - "lcov-parse": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", - "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", - "dev": true - }, - "left-pad": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", - "dev": true - }, - "leven": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", - "dev": true - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" - } - }, - "loader-runner": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz", - "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=", - "dev": true - }, - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } - } - }, - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", - "dev": true - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, - "log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", - "dev": true - }, - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=", - "dev": true - }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true - }, - "loose-envify": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", - "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", - "dev": true, - "requires": { - "js-tokens": "3.0.2" - } - }, - "lru-cache": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", - "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", - "dev": true, - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "makeerror": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", - "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", - "dev": true, - "requires": { - "tmpl": "1.0.4" - } - }, - "mamacro": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", - "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", - "dev": true - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "1.0.1" - } - }, - "marked": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", - "dev": true - }, - "md5.js": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", - "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", - "dev": true, - "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.3" - } - }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "dev": true, - "requires": { - "mimic-fn": "1.2.0" - } - }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "0.1.7", - "readable-stream": "2.3.6" - } - }, - "merge": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", - "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=", - "dev": true - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "2.3.6" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0" - } - }, - "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", - "dev": true - }, - "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", - "dev": true, - "requires": { - "mime-db": "1.33.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mississippi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", - "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", - "dev": true, - "requires": { - "concat-stream": "1.6.2", - "duplexify": "3.5.4", - "end-of-stream": "1.4.1", - "flush-write-stream": "1.0.3", - "from2": "2.3.0", - "parallel-transform": "1.1.0", - "pump": "2.0.1", - "pumpify": "1.5.1", - "stream-each": "1.2.2", - "through2": "2.0.3" - } - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "dev": true, - "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "1.2.0", - "copy-concurrently": "1.0.5", - "fs-write-stream-atomic": "1.0.10", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "run-queue": "1.0.3" - }, - "dependencies": { - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "7.0.6" - } - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", - "dev": true, - "optional": true - }, - "nanomatch": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-odd": "2.0.0", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "neo-async": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.5.1.tgz", - "integrity": "sha512-3KL3fvuRkZ7s4IFOMfztb7zJp3QaVWnBeGoJlgB38XnCRPj/0tLzzLG5IB8NYOHbJ8g8UGrgZv44GLDk6CxTxA==", - "dev": true - }, - "nice-try": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", - "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", - "dev": true - }, - "node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", - "dev": true - }, - "node-libs-browser": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", - "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", - "dev": true, - "requires": { - "assert": "1.4.1", - "browserify-zlib": "0.2.0", - "buffer": "4.9.1", - "console-browserify": "1.1.0", - "constants-browserify": "1.0.0", - "crypto-browserify": "3.12.0", - "domain-browser": "1.2.0", - "events": "1.1.1", - "https-browserify": "1.0.0", - "os-browserify": "0.3.0", - "path-browserify": "0.0.0", - "process": "0.11.10", - "punycode": "1.4.1", - "querystring-es3": "0.2.1", - "readable-stream": "2.3.6", - "stream-browserify": "2.0.1", - "stream-http": "2.8.1", - "string_decoder": "1.1.1", - "timers-browserify": "2.0.10", - "tty-browserify": "0.0.0", - "url": "0.11.0", - "util": "0.10.3", - "vm-browserify": "0.0.4" - }, - "dependencies": { - "buffer": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", - "dev": true, - "requires": { - "base64-js": "1.3.0", - "ieee754": "1.1.11", - "isarray": "1.0.0" - } - }, - "events": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", - "dev": true - }, - "timers-browserify": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", - "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", - "dev": true, - "requires": { - "setimmediate": "1.0.5" - } - }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, - "vm-browserify": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", - "dev": true, - "requires": { - "indexof": "0.0.1" - } - } - } - }, - "node-notifier": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.2.1.tgz", - "integrity": "sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg==", - "dev": true, - "requires": { - "growly": "1.3.0", - "semver": "5.5.0", - "shellwords": "0.1.1", - "which": "1.3.0" - }, - "dependencies": { - "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", - "dev": true, - "requires": { - "isexe": "2.0.0" - } - } - } - }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "dev": true, - "requires": { - "hosted-git-info": "2.6.0", - "is-builtin-module": "1.0.0", - "semver": "5.5.0", - "validate-npm-package-license": "3.0.3" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "1.1.0" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "2.0.1" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "nwmatcher": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", - "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - } - } - }, - "object-keys": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", - "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "dev": true, - "requires": { - "define-properties": "1.1.2", - "es-abstract": "1.11.0" - } - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "1.2.0" - } - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.2" - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" - }, - "dependencies": { - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - } - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-limit": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", - "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", - "dev": true, - "requires": { - "p-try": "1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "1.2.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "pako": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", - "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", - "dev": true - }, - "parallel-transform": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", - "dev": true, - "requires": { - "cyclist": "0.2.2", - "inherits": "2.0.3", - "readable-stream": "2.3.6" - } - }, - "parse-asn1": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", - "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", - "dev": true, - "requires": { - "asn1.js": "4.10.1", - "browserify-aes": "1.2.0", - "create-hash": "1.2.0", - "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.16" - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "1.3.1" - } - }, - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "2.0.1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", - "dev": true - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - } - }, - "pbkdf2": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.16.tgz", - "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", - "dev": true, - "requires": { - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "ripemd160": "2.0.2", - "safe-buffer": "5.1.2", - "sha.js": "2.4.11" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "2.0.4" - } - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "2.1.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "2.0.0" - } - } - } - }, - "pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", - "dev": true - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "prettier": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.12.1.tgz", - "integrity": "sha1-wa0g6APndJ+vkFpAnSNn4Gu+cyU=", - "dev": true - }, - "pretty-format": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-22.4.3.tgz", - "integrity": "sha512-S4oT9/sT6MN7/3COoOy+ZJeA92VmOnveLHgrwBE3Z1W5N9S2A1QGNYiE1z75DAENbJrXXUb+OWXhpJcg05QKQQ==", - "dev": true, - "requires": { - "ansi-regex": "3.0.0", - "ansi-styles": "3.2.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - } - } - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "public-encrypt": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz", - "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.2.0", - "parse-asn1": "5.1.1", - "randombytes": "2.0.6" - } - }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "3.6.0", - "inherits": "2.0.3", - "pump": "2.0.1" - }, - "dependencies": { - "duplexify": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", - "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", - "dev": true, - "requires": { - "end-of-stream": "1.4.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "stream-shift": "1.0.0" - } - } - } - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", - "dev": true - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "2.0.6", - "safe-buffer": "5.1.2" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "minimatch": "3.0.4", - "readable-stream": "2.3.6", - "set-immediate-shim": "1.0.1" - } - }, - "realpath-native": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.0.tgz", - "integrity": "sha512-XJtlRJ9jf0E1H1SLeJyQ9PGzQD7S65h1pRXEcAeK48doKOnKxcgPeNohJvD5u/2sI9J1oke6E8bZHS/fmW1UiQ==", - "dev": true, - "requires": { - "util.promisify": "1.0.0" - } - }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", - "dev": true - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - }, - "regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "private": "0.1.8" - } - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "0.1.3" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", - "dev": true, - "requires": { - "regenerate": "1.4.0", - "regjsgen": "0.2.0", - "regjsparser": "0.1.5" - } - }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", - "dev": true - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "dev": true, - "requires": { - "jsesc": "0.5.0" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "1.0.2" - } - }, - "request": { - "version": "2.85.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", - "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", - "dev": true, - "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.7.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.2", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" - } - }, - "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", - "dev": true, - "requires": { - "lodash": "4.17.10" - } - }, - "request-promise-native": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", - "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", - "dev": true, - "requires": { - "request-promise-core": "1.1.1", - "stealthy-require": "1.1.1", - "tough-cookie": "2.3.4" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "requizzle": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", - "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", - "dev": true, - "requires": { - "underscore": "1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "3.0.0" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "2.0.1", - "signal-exit": "3.0.2" - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "optional": true, - "requires": { - "align-text": "0.1.4" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.3" - } - }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "2.1.0" - } - }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "1.2.0" - } - }, - "rxjs": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.1.tgz", - "integrity": "sha512-OwMxHxmnmHTUpgO+V7dZChf3Tixf4ih95cmXjzzadULziVl/FKhHScGLj4goEw9weePVOH2Q0+GcCBUhKCZc/g==", - "dev": true, - "requires": { - "tslib": "1.9.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "0.1.15" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sane": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.0.tgz", - "integrity": "sha512-glfKd7YH4UCrh/7dD+UESsr8ylKWRE7UQPoXuz28FgmcF0ViJQhCTCCZHICRKxf8G8O1KdLEn20dcICK54c7ew==", - "dev": true, - "requires": { - "anymatch": "2.0.0", - "exec-sh": "0.2.1", - "fb-watchman": "2.0.0", - "fsevents": "1.2.3", - "micromatch": "3.1.10", - "minimist": "1.2.0", - "walker": "1.0.7", - "watch": "0.18.0" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "3.1.10", - "normalize-path": "2.1.1" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, - "schema-utils": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.5.tgz", - "integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==", - "dev": true, - "requires": { - "ajv": "6.5.2", - "ajv-keywords": "3.2.0" - }, - "dependencies": { - "ajv": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", - "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", - "dev": true, - "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } - } - }, - "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", - "dev": true - }, - "serialize-javascript": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz", - "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==", - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.2" - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.1", - "use": "3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", - "dev": true, - "requires": { - "hoek": "4.2.1" - } - }, - "source-list-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", - "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", - "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", - "dev": true, - "requires": { - "atob": "2.1.1", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" - } - }, - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "dev": true, - "requires": { - "source-map": "0.5.7" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", - "dev": true, - "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "sshpk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", - "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", - "dev": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - } - }, - "ssri": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", - "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "stack-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz", - "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", - "dev": true - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - } - } - }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true - }, - "stream-browserify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" - } - }, - "stream-each": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", - "integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", - "dev": true, - "requires": { - "end-of-stream": "1.4.1", - "stream-shift": "1.0.0" - } - }, - "stream-http": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.1.tgz", - "integrity": "sha512-cQ0jo17BLca2r0GfRdZKYAGLU6JRoIWxqSOakUMuKOT6MOK7AAlE856L33QuDmAy/eeOrhLee3dZKX0Uadu93A==", - "dev": true, - "requires": { - "builtin-status-codes": "3.0.0", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "to-arraybuffer": "1.0.1", - "xtend": "4.0.1" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, - "string-length": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", - "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", - "dev": true, - "requires": { - "astral-regex": "1.0.0", - "strip-ansi": "4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - } - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "symbol-tree": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", - "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", - "dev": true - }, - "tapable": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.0.0.tgz", - "integrity": "sha512-dQRhbNQkRnaqauC7WqSJ21EEksgT0fYZX2lqXzGkpo8JNig9zGZTYoMGvyI2nWmXlE2VSVXVDu7wLVGu/mQEsg==", - "dev": true - }, - "test-exclude": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.1.tgz", - "integrity": "sha512-qpqlP/8Zl+sosLxBcVKl9vYy26T9NPalxSzzCP/OY6K7j938ui2oKgo+kRZYfxAeIpLqpbVnsHq1tyV70E4lWQ==", - "dev": true, - "requires": { - "arrify": "1.0.1", - "micromatch": "3.1.10", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "require-main-filename": "1.0.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - } - } - }, - "throat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", - "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "dev": true, - "requires": { - "readable-stream": "2.3.6", - "xtend": "4.0.1" - } - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "1.0.2" - } - }, - "tmpl": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", - "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", - "dev": true - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - } - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - } - } - }, - "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", - "dev": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", - "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=", - "dev": true - } - } - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "1.1.2" - } - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", - "dev": true, - "optional": true, - "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, - "uglifyjs-webpack-plugin": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.7.tgz", - "integrity": "sha512-1VicfKhCYHLS8m1DCApqBhoulnASsEoJ/BvpUpP4zoNAPpKzdH+ghk0olGJMmwX2/jprK2j3hAHdUbczBSy2FA==", - "dev": true, - "requires": { - "cacache": "10.0.4", - "find-cache-dir": "1.0.0", - "schema-utils": "0.4.5", - "serialize-javascript": "1.5.0", - "source-map": "0.6.1", - "uglify-es": "3.3.9", - "webpack-sources": "1.1.0", - "worker-farm": "1.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", - "dev": true, - "requires": { - "commander": "2.13.0", - "source-map": "0.6.1" - } - } - } - }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", - "dev": true - }, - "underscore-contrib": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", - "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", - "dev": true, - "requires": { - "underscore": "1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" - }, - "dependencies": { - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" - } - } - } - }, - "unique-filename": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.0.tgz", - "integrity": "sha1-0F8v5AMlYIcfMOk8vnNe6iAVFPM=", - "dev": true, - "requires": { - "unique-slug": "2.0.0" - } - }, - "unique-slug": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz", - "integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=", - "dev": true, - "requires": { - "imurmurhash": "0.1.4" - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "upath": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", - "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", - "dev": true - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "2.1.1" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "use": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", - "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "util.promisify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", - "dev": true, - "requires": { - "define-properties": "1.1.2", - "object.getownpropertydescriptors": "2.0.3" - } - }, - "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", - "dev": true - }, - "v8-compile-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.0.tgz", - "integrity": "sha512-qNdTUMaCjPs4eEnM3W9H94R3sU70YCuT+/ST7nUf+id1bVOrdjrpUaeZLqPBPRph3hsgn4a4BvwpxhHZx+oSDg==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", - "dev": true, - "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "1.3.0" - } - }, - "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", - "dev": true, - "requires": { - "browser-process-hrtime": "0.1.2" - } - }, - "walker": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", - "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", - "dev": true, - "requires": { - "makeerror": "1.0.11" - } - }, - "watch": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/watch/-/watch-0.18.0.tgz", - "integrity": "sha1-KAlUdsbffJDJYxOJkMClQj60uYY=", - "dev": true, - "requires": { - "exec-sh": "0.2.1", - "minimist": "1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, - "watchpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", - "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", - "dev": true, - "requires": { - "chokidar": "2.0.4", - "graceful-fs": "4.1.11", - "neo-async": "2.5.1" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "3.1.10", - "normalize-path": "2.1.1" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "chokidar": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", - "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", - "dev": true, - "requires": { - "anymatch": "2.0.0", - "async-each": "1.0.1", - "braces": "2.3.2", - "fsevents": "1.2.3", - "glob-parent": "3.1.0", - "inherits": "2.0.3", - "is-binary-path": "1.0.1", - "is-glob": "4.0.0", - "lodash.debounce": "4.0.8", - "normalize-path": "2.1.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.1.0", - "upath": "1.1.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - } - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "webpack": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.15.1.tgz", - "integrity": "sha512-UwfFQ2plA5EMhhzwi/hl5xpLk7mNK7p0853Ml04z1Bqw553pY+oS8Xke3funcVy7eG/yMpZPvnlFTUyGKyKoyw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-module-context": "1.5.13", - "@webassemblyjs/wasm-edit": "1.5.13", - "@webassemblyjs/wasm-opt": "1.5.13", - "@webassemblyjs/wasm-parser": "1.5.13", - "acorn": "5.7.1", - "acorn-dynamic-import": "3.0.0", - "ajv": "6.5.2", - "ajv-keywords": "3.2.0", - "chrome-trace-event": "1.0.0", - "enhanced-resolve": "4.1.0", - "eslint-scope": "3.7.1", - "json-parse-better-errors": "1.0.2", - "loader-runner": "2.3.0", - "loader-utils": "1.1.0", - "memory-fs": "0.4.1", - "micromatch": "3.1.10", - "mkdirp": "0.5.1", - "neo-async": "2.5.1", - "node-libs-browser": "2.1.0", - "schema-utils": "0.4.5", - "tapable": "1.0.0", - "uglifyjs-webpack-plugin": "1.2.7", - "watchpack": "1.6.0", - "webpack-sources": "1.1.0" - }, - "dependencies": { - "acorn": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", - "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", - "dev": true - }, - "ajv": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz", - "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==", - "dev": true, - "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - } - } - }, - "webpack-cli": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.0.8.tgz", - "integrity": "sha512-KnRLJ0BUaYRqrhAMb9dv3gzdmhmgIMKo0FmdsnmfqbPGtLnnZ6tORZAvmmKfr+A0VgiVpqC60Gv7Ofg0R2CHtQ==", - "dev": true, - "requires": { - "chalk": "2.4.1", - "cross-spawn": "6.0.5", - "enhanced-resolve": "4.1.0", - "global-modules-path": "2.1.0", - "import-local": "1.0.0", - "inquirer": "6.0.0", - "interpret": "1.1.0", - "loader-utils": "1.1.0", - "supports-color": "5.4.0", - "v8-compile-cache": "2.0.0", - "yargs": "11.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - } - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "1.0.4", - "path-key": "2.0.1", - "semver": "5.5.0", - "shebang-command": "1.2.0", - "which": "1.2.14" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "2.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "3.0.0" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "yargs": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", - "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", - "dev": true, - "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "9.0.2" - } - }, - "yargs-parser": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", - "dev": true, - "requires": { - "camelcase": "4.1.0" - } - } - } - }, - "webpack-sources": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.1.0.tgz", - "integrity": "sha512-aqYp18kPphgoO5c/+NaUvEeACtZjMESmDChuD3NBciVpah3XpMEU9VAAtIaB1BsfJWWTSdv8Vv1m3T0aRk2dUw==", - "dev": true, - "requires": { - "source-list-map": "2.0.0", - "source-map": "0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "whatwg-encoding": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz", - "integrity": "sha512-jLBwwKUhi8WtBfsMQlL4bUUcT8sMkAtQinscJAe/M4KHCkHuUJAF6vuB0tueNIw4c8ziO6AkRmgY+jL3a0iiPw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.19" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true - } - } - }, - "whatwg-mimetype": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz", - "integrity": "sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew==", - "dev": true - }, - "whatwg-url": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.4.1.tgz", - "integrity": "sha512-FwygsxsXx27x6XXuExA/ox3Ktwcbf+OAvrKmLulotDAiO1Q6ixchPFaHYsis2zZBZSJTR0+dR+JVtf7MlbqZjw==", - "dev": true, - "requires": { - "lodash.sortby": "4.7.0", - "tr46": "1.0.1", - "webidl-conversions": "4.0.2" - } - }, - "which": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", - "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", - "dev": true, - "requires": { - "isexe": "2.0.0" - } - }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true, - "optional": true - }, - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true - }, - "worker-farm": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", - "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", - "dev": true, - "requires": { - "errno": "0.1.7" - } - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "signal-exit": "3.0.2" - } - }, - "ws": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", - "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", - "dev": true, - "requires": { - "async-limiter": "1.0.0", - "safe-buffer": "5.1.2" - } - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "xmlcreate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", - "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "optional": true, - "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", - "window-size": "0.1.0" - }, - "dependencies": { - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true, - "optional": true - } - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index f2ab4e821..000000000 --- a/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "php-parser", - "version": "3.0.0-prerelease.1", - "description": "Parse PHP code and returns its AST", - "main": "src/index.js", - "browser": "dist/php-parser.js", - "scripts": { - "lint": "prettier --write src/*.js src/**/*.js", - "pretest": "npm run lint", - "test": "jest", - "prebuild": "npm run test", - "build": "webpack --config webpack.config.js", - "postbuild": "npm run build-docs", - "build-docs": "jsdoc -c .jsdoc.json", - "cover": "jest --coverage --coverageDirectory=coverage/" - }, - "repository": { - "type": "git", - "url": "https://github.com/glayzzle/php-parser" - }, - "bugs": { - "url": "https://github.com/glayzzle/php-parser/issues" - }, - "homepage": "https://glayzzle.com/", - "keywords": [ - "php", - "php5", - "php7", - "parser", - "lexer", - "tokenizer", - "ast" - ], - "author": "Ioan CHIRIAC", - "contributors": [ - { - "name": "Filippo Conti", - "email": "filippo@codekraft.it", - "url": "https://b4dnewz.github.io/" - }, - { - "name": "Christian Zosel", - "email": "christian@zosel.ch", - "url": "https://twitter.com/chrzosel" - } - ], - "license": "BSD-3-Clause", - "jest": { - "testEnvironment": "node", - "testURL": "http://localhost/" - }, - "devDependencies": { - "babel-loader": "^7", - "babel-preset-es2015": "^6", - "coveralls": "^3", - "eslint-plugin-prettier": "^2.6.2", - "jest": "^22.4", - "jsdoc": "^3.5.5", - "jsdoc-template": "github:braintree/jsdoc-template", - "prettier": "^1.9", - "webpack": "^4.15.1", - "webpack-cli": "^3.0.8" - } -} diff --git a/parser.html b/parser.html new file mode 100644 index 000000000..561d8331c --- /dev/null +++ b/parser.html @@ -0,0 +1,1590 @@ + + + + + + + + + parser - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser +

+ + + + +
+
+ +

+ + parser + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new parser() +

+
+ + + + + +
+

The PHP Parser class that build the AST tree from the lexer

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
lexer + + + + Lexer + + + + + + + +

current lexer instance

+
ast + + + + AST + + + + + + + +

the AST factory instance

+
token + + + + Integer + + + | + + + String + + + + + + + +

current token

+
extractDoc + + + + Boolean + + + + + + + +

should extract documentation as AST node

+
extractTokens + + + + Boolean + + + + + + + +

should extract each token

+
suppressErrors + + + + Boolean + + + + + + + +

should ignore parsing errors and continue

+
debug + + + + Boolean + + + + + + + +

should output debug informations

+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + +
Tutorials:
+
+ +
+ + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ error() +

+
+ + + + + +
+

handling errors

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ expect(token) → {boolean} +

+
+ + + + + +
+

Force the parser to check the current token.

+

If the current token does not match to expected token, +the an error will be raised.

+

If the suppressError mode is activated, then the error will +be added to the program error stack and this function will return false.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
token + + + + String + + + | + + + Number + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + +
Throws:
+ + + +
+ +

Error

+ +
+ + + + + + + + + + + + + + + + + + +

+ expectEndOfStatement() → {boolean} +

+
+ + + + + +
+

expects an end of statement or end of file

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ getTokenName() +

+
+ + + + + +
+

helper : gets a token name

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ is() +

+
+ + + + + +
+

Check if token is of specified type

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ lex() +

+
+ + + + + +
+

Eating a token

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ next() +

+
+ + + + + +
+

consume the next token

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ node() +

+
+ + + + + +
+

Creates a new AST node

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ parse() +

+
+ + + + + +
+

main entry point : converts a source code to AST

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ raiseError() +

+
+ + + + + +
+

Raise an error

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+ text() → {String} +

+
+ + + + + +
+

Returns the current token contents

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/parser.js.html b/parser.js.html new file mode 100644 index 000000000..c39907e7a --- /dev/null +++ b/parser.js.html @@ -0,0 +1,704 @@ + + + + + + + + + + + parser.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+/**
+ * @private
+ */
+function isNumber(n) {
+  return n != "." && n != "," && !isNaN(parseFloat(n)) && isFinite(n);
+}
+
+/**
+ * The PHP Parser class that build the AST tree from the lexer
+ *
+ * @class
+ * @tutorial Parser
+ * @property {Lexer} lexer - current lexer instance
+ * @property {AST} ast - the AST factory instance
+ * @property {Integer|String} token - current token
+ * @property {Boolean} extractDoc - should extract documentation as AST node
+ * @property {Boolean} extractTokens - should extract each token
+ * @property {Boolean} suppressErrors - should ignore parsing errors and continue
+ * @property {Boolean} debug - should output debug informations
+ */
+const parser = function(lexer, ast) {
+  this.lexer = lexer;
+  this.ast = ast;
+  this.tok = lexer.tok;
+  this.EOF = lexer.EOF;
+  this.token = null;
+  this.prev = null;
+  this.debug = false;
+  this.php7 = true;
+  this.extractDoc = false;
+  this.extractTokens = false;
+  this.suppressErrors = false;
+  const mapIt = function(item) {
+    return [item, null];
+  };
+  this.entries = {
+    IDENTIFIER: new Map(
+      [
+        this.tok.T_ABSTRACT,
+        this.tok.T_ARRAY,
+        this.tok.T_AS,
+        this.tok.T_BREAK,
+        this.tok.T_CALLABLE,
+        this.tok.T_CASE,
+        this.tok.T_CATCH,
+        this.tok.T_CLASS,
+        this.tok.T_CLASS_C,
+        this.tok.T_CLONE,
+        this.tok.T_CONST,
+        this.tok.T_CONTINUE,
+        this.tok.T_DECLARE,
+        this.tok.T_DEFAULT,
+        this.tok.T_DIR,
+        this.tok.T_DO,
+        this.tok.T_ECHO,
+        this.tok.T_ELSE,
+        this.tok.T_ELSEIF,
+        this.tok.T_EMPTY,
+        this.tok.T_ENDDECLARE,
+        this.tok.T_ENDFOR,
+        this.tok.T_ENDFOREACH,
+        this.tok.T_ENDIF,
+        this.tok.T_ENDSWITCH,
+        this.tok.T_ENDWHILE,
+        this.tok.T_EVAL,
+        this.tok.T_EXIT,
+        this.tok.T_EXTENDS,
+        this.tok.T_FILE,
+        this.tok.T_FINAL,
+        this.tok.T_FINALLY,
+        this.tok.T_FUNC_C,
+        this.tok.T_FOR,
+        this.tok.T_FOREACH,
+        this.tok.T_FUNCTION,
+        this.tok.T_GLOBAL,
+        this.tok.T_GOTO,
+        this.tok.T_IF,
+        this.tok.T_IMPLEMENTS,
+        this.tok.T_INCLUDE,
+        this.tok.T_INCLUDE_ONCE,
+        this.tok.T_INSTANCEOF,
+        this.tok.T_INSTEADOF,
+        this.tok.T_INTERFACE,
+        this.tok.T_ISSET,
+        this.tok.T_LINE,
+        this.tok.T_LIST,
+        this.tok.T_LOGICAL_AND,
+        this.tok.T_LOGICAL_OR,
+        this.tok.T_LOGICAL_XOR,
+        this.tok.T_METHOD_C,
+        this.tok.T_NAMESPACE,
+        this.tok.T_NEW,
+        this.tok.T_NS_C,
+        this.tok.T_PRINT,
+        this.tok.T_PRIVATE,
+        this.tok.T_PROTECTED,
+        this.tok.T_PUBLIC,
+        this.tok.T_REQUIRE,
+        this.tok.T_REQUIRE_ONCE,
+        this.tok.T_RETURN,
+        this.tok.T_STATIC,
+        this.tok.T_SWITCH,
+        this.tok.T_THROW,
+        this.tok.T_TRAIT,
+        this.tok.T_TRY,
+        this.tok.T_UNSET,
+        this.tok.T_USE,
+        this.tok.T_VAR,
+        this.tok.T_WHILE,
+        this.tok.T_YIELD
+      ].map(mapIt)
+    ),
+    VARIABLE: new Map(
+      [
+        this.tok.T_VARIABLE,
+        "$",
+        "&",
+        this.tok.T_NS_SEPARATOR,
+        this.tok.T_STRING,
+        this.tok.T_NAMESPACE,
+        this.tok.T_STATIC
+      ].map(mapIt)
+    ),
+    SCALAR: new Map(
+      [
+        this.tok.T_CONSTANT_ENCAPSED_STRING,
+        this.tok.T_START_HEREDOC,
+        this.tok.T_LNUMBER,
+        this.tok.T_DNUMBER,
+        this.tok.T_ARRAY,
+        "[",
+        this.tok.T_CLASS_C,
+        this.tok.T_TRAIT_C,
+        this.tok.T_FUNC_C,
+        this.tok.T_METHOD_C,
+        this.tok.T_LINE,
+        this.tok.T_FILE,
+        this.tok.T_DIR,
+        this.tok.T_NS_C,
+        '"',
+        'b"',
+        'B"',
+        "-",
+        this.tok.T_NS_SEPARATOR
+      ].map(mapIt)
+    ),
+    T_MAGIC_CONST: new Map(
+      [
+        this.tok.T_CLASS_C,
+        this.tok.T_TRAIT_C,
+        this.tok.T_FUNC_C,
+        this.tok.T_METHOD_C,
+        this.tok.T_LINE,
+        this.tok.T_FILE,
+        this.tok.T_DIR,
+        this.tok.T_NS_C
+      ].map(mapIt)
+    ),
+    T_MEMBER_FLAGS: new Map(
+      [
+        this.tok.T_PUBLIC,
+        this.tok.T_PRIVATE,
+        this.tok.T_PROTECTED,
+        this.tok.T_STATIC,
+        this.tok.T_ABSTRACT,
+        this.tok.T_FINAL
+      ].map(mapIt)
+    ),
+    EOS: new Map([";", this.EOF, this.tok.T_INLINE_HTML].map(mapIt)),
+    EXPR: new Map(
+      [
+        "@",
+        "-",
+        "+",
+        "!",
+        "~",
+        "(",
+        "`",
+        this.tok.T_LIST,
+        this.tok.T_CLONE,
+        this.tok.T_INC,
+        this.tok.T_DEC,
+        this.tok.T_NEW,
+        this.tok.T_ISSET,
+        this.tok.T_EMPTY,
+        this.tok.T_INCLUDE,
+        this.tok.T_INCLUDE_ONCE,
+        this.tok.T_REQUIRE,
+        this.tok.T_REQUIRE_ONCE,
+        this.tok.T_EVAL,
+        this.tok.T_INT_CAST,
+        this.tok.T_DOUBLE_CAST,
+        this.tok.T_STRING_CAST,
+        this.tok.T_ARRAY_CAST,
+        this.tok.T_OBJECT_CAST,
+        this.tok.T_BOOL_CAST,
+        this.tok.T_UNSET_CAST,
+        this.tok.T_EXIT,
+        this.tok.T_PRINT,
+        this.tok.T_YIELD,
+        this.tok.T_STATIC,
+        this.tok.T_FUNCTION,
+        // using VARIABLES :
+        this.tok.T_VARIABLE,
+        "$",
+        this.tok.T_NS_SEPARATOR,
+        this.tok.T_STRING,
+        // using SCALAR :
+        this.tok.T_STRING, // @see variable.js line 45 > conflict with variable = shift/reduce :)
+        this.tok.T_CONSTANT_ENCAPSED_STRING,
+        this.tok.T_START_HEREDOC,
+        this.tok.T_LNUMBER,
+        this.tok.T_DNUMBER,
+        this.tok.T_ARRAY,
+        "[",
+        this.tok.T_CLASS_C,
+        this.tok.T_TRAIT_C,
+        this.tok.T_FUNC_C,
+        this.tok.T_METHOD_C,
+        this.tok.T_LINE,
+        this.tok.T_FILE,
+        this.tok.T_DIR,
+        this.tok.T_NS_C
+      ].map(mapIt)
+    )
+  };
+};
+
+/**
+ * helper : gets a token name
+ */
+parser.prototype.getTokenName = function(token) {
+  if (!isNumber(token)) {
+    return "'" + token + "'";
+  } else {
+    if (token == this.EOF) return "the end of file (EOF)";
+    return this.lexer.engine.tokens.values[token];
+  }
+};
+
+/**
+ * main entry point : converts a source code to AST
+ */
+parser.prototype.parse = function(code, filename) {
+  this._errors = [];
+  this.filename = filename || "eval";
+  this.currentNamespace = [""];
+  if (this.extractDoc) {
+    this._docs = [];
+  } else {
+    this._docs = null;
+  }
+  if (this.extractTokens) {
+    this._tokens = [];
+  } else {
+    this._tokens = null;
+  }
+  this._docIndex = 0;
+  this.lexer.setInput(code);
+  this.lexer.all_tokens = this.extractTokens;
+  this.lexer.comment_tokens = this.extractDoc;
+  this.length = this.lexer._input.length;
+  this.innerList = false;
+  this.innerListForm = false;
+  const program = this.ast.prepare("program", null, this);
+  let childs = [];
+  this.next();
+  while (this.token != this.EOF) {
+    const node = this.read_start();
+    if (node !== null && node !== undefined) {
+      if (Array.isArray(node)) {
+        childs = childs.concat(node);
+      } else {
+        childs.push(node);
+      }
+    }
+  }
+  return program(childs, this._errors, this._docs, this._tokens);
+};
+
+/**
+ * Raise an error
+ */
+parser.prototype.raiseError = function(message, msgExpect, expect, token) {
+  message += " on line " + this.lexer.yylloc.first_line;
+  if (!this.suppressErrors) {
+    const err = new SyntaxError(
+      message,
+      this.filename,
+      this.lexer.yylloc.first_line
+    );
+    err.lineNumber = this.lexer.yylloc.first_line;
+    err.fileName = this.filename;
+    err.columnNumber = this.lexer.yylloc.first_column;
+    throw err;
+  }
+  // Error node :
+  const node = this.ast.prepare("error", null, this)(
+    message,
+    token,
+    this.lexer.yylloc.first_line,
+    expect
+  );
+  this._errors.push(node);
+  return node;
+};
+
+/**
+ * handling errors
+ */
+parser.prototype.error = function(expect) {
+  let msg = "Parse Error : syntax error";
+  let token = this.getTokenName(this.token);
+  let msgExpect = "";
+
+  if (this.token !== this.EOF) {
+    if (isNumber(this.token)) {
+      let symbol = this.text();
+      if (symbol.length > 10) {
+        symbol = symbol.substring(0, 7) + "...";
+      }
+      token = "'" + symbol + "' (" + token + ")";
+    }
+    msg += ", unexpected " + token;
+  }
+  if (expect && !Array.isArray(expect)) {
+    if (isNumber(expect) || expect.length === 1) {
+      msgExpect = ", expecting " + this.getTokenName(expect);
+    }
+    msg += msgExpect;
+  }
+  return this.raiseError(msg, msgExpect, expect, token);
+};
+
+/**
+ * Creates a new AST node
+ */
+parser.prototype.node = function(name) {
+  if (this.extractDoc) {
+    if (this._docIndex < this._docs.length) {
+      const docs = this._docs.slice(this._docIndex);
+      this._docIndex = this._docs.length;
+      return this.ast.prepare(name, docs, this);
+    }
+  }
+  return this.ast.prepare(name, null, this);
+};
+
+/**
+ * expects an end of statement or end of file
+ * @return {boolean}
+ */
+parser.prototype.expectEndOfStatement = function(node) {
+  if (this.token === ";") {
+    // include only real ';' statements
+    // https://github.com/glayzzle/php-parser/issues/164
+    if (node && this.lexer.yytext === ";") {
+      node.includeToken(this);
+    }
+  } else if (this.token !== this.tok.T_INLINE_HTML && this.token !== this.EOF) {
+    this.error(";");
+    return false;
+  }
+  this.next();
+  return true;
+};
+
+/** outputs some debug information on current token **/
+const ignoreStack = ["parser.next"];
+parser.prototype.showlog = function() {
+  const stack = new Error().stack.split("\n");
+  let line;
+  for (let offset = 2; offset < stack.length; offset++) {
+    line = stack[offset].trim();
+    let found = false;
+    for (let i = 0; i < ignoreStack.length; i++) {
+      if (line.substring(3, 3 + ignoreStack[i].length) === ignoreStack[i]) {
+        found = true;
+        break;
+      }
+    }
+    if (!found) {
+      break;
+    }
+  }
+  // eslint-disable-next-line no-console
+  console.log(
+    "Line " +
+      this.lexer.yylloc.first_line +
+      " : " +
+      this.getTokenName(this.token) +
+      ">" +
+      this.lexer.yytext +
+      "<" +
+      " @-->" +
+      line
+  );
+  return this;
+};
+
+/**
+ * Force the parser to check the current token.
+ *
+ * If the current token does not match to expected token,
+ * the an error will be raised.
+ *
+ * If the suppressError mode is activated, then the error will
+ * be added to the program error stack and this function will return `false`.
+ *
+ * @param {String|Number} token
+ * @return {boolean}
+ * @throws Error
+ */
+parser.prototype.expect = function(token) {
+  if (Array.isArray(token)) {
+    if (token.indexOf(this.token) === -1) {
+      this.error(token);
+      return false;
+    }
+  } else if (this.token != token) {
+    this.error(token);
+    return false;
+  }
+  return true;
+};
+
+/**
+ * Returns the current token contents
+ * @return {String}
+ */
+parser.prototype.text = function() {
+  return this.lexer.yytext;
+};
+
+/** consume the next token **/
+parser.prototype.next = function() {
+  // prepare the back command
+  if (this.token !== ";" || this.lexer.yytext === ";") {
+    // ignore '?>' from automated resolution
+    // https://github.com/glayzzle/php-parser/issues/168
+    this.prev = [
+      this.lexer.yylloc.last_line,
+      this.lexer.yylloc.last_column,
+      this.lexer.offset
+    ];
+  }
+
+  // eating the token
+  this.lex();
+
+  // showing the debug
+  if (this.debug) {
+    this.showlog();
+  }
+
+  // handling comments
+  if (this.extractDoc) {
+    while (
+      this.token === this.tok.T_COMMENT ||
+      this.token === this.tok.T_DOC_COMMENT
+    ) {
+      // APPEND COMMENTS
+      if (this.token === this.tok.T_COMMENT) {
+        this._docs.push(this.read_comment());
+      } else {
+        this._docs.push(this.read_doc_comment());
+      }
+    }
+  }
+
+  return this;
+};
+
+/**
+ * Eating a token
+ */
+parser.prototype.lex = function() {
+  // append on token stack
+  if (this.extractTokens) {
+    do {
+      // the token
+      this.token = this.lexer.lex() || this.EOF;
+      if (this.token === this.EOF) return this;
+      let entry = this.lexer.yytext;
+      if (this.lexer.engine.tokens.values.hasOwnProperty(this.token)) {
+        entry = [
+          this.lexer.engine.tokens.values[this.token],
+          entry,
+          this.lexer.yylloc.first_line,
+          this.lexer.yylloc.first_offset,
+          this.lexer.offset
+        ];
+      } else {
+        entry = [
+          null,
+          entry,
+          this.lexer.yylloc.first_line,
+          this.lexer.yylloc.first_offset,
+          this.lexer.offset
+        ];
+      }
+      this._tokens.push(entry);
+      if (this.token === this.tok.T_CLOSE_TAG) {
+        // https://github.com/php/php-src/blob/7ff186434e82ee7be7c59d0db9a976641cf7b09c/Zend/zend_compile.c#L1680
+        this.token = ";";
+        return this;
+      } else if (this.token === this.tok.T_OPEN_TAG_WITH_ECHO) {
+        this.token = this.tok.T_ECHO;
+        return this;
+      }
+    } while (
+      this.token === this.tok.T_WHITESPACE || // ignore white space
+      (!this.extractDoc &&
+        (this.token === this.tok.T_COMMENT || // ignore single lines comments
+          this.token === this.tok.T_DOC_COMMENT)) || // ignore doc comments
+      // ignore open tags
+      this.token === this.tok.T_OPEN_TAG
+    );
+  } else {
+    this.token = this.lexer.lex() || this.EOF;
+  }
+  return this;
+};
+
+/**
+ * Check if token is of specified type
+ */
+parser.prototype.is = function(type) {
+  if (Array.isArray(type)) {
+    return type.indexOf(this.token) !== -1;
+  }
+  return this.entries[type].has(this.token);
+};
+
+// extends the parser with syntax files
+[
+  require("./parser/array.js"),
+  require("./parser/class.js"),
+  require("./parser/comment.js"),
+  require("./parser/expr.js"),
+  require("./parser/function.js"),
+  require("./parser/if.js"),
+  require("./parser/loops.js"),
+  require("./parser/main.js"),
+  require("./parser/namespace.js"),
+  require("./parser/scalar.js"),
+  require("./parser/statement.js"),
+  require("./parser/switch.js"),
+  require("./parser/try.js"),
+  require("./parser/utils.js"),
+  require("./parser/variable.js")
+].forEach(function(ext) {
+  for (const k in ext) {
+    parser.prototype[k] = ext[k];
+  }
+});
+
+module.exports = parser;
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_array.js.html b/parser_array.js.html new file mode 100644 index 000000000..5dd3cf649 --- /dev/null +++ b/parser_array.js.html @@ -0,0 +1,244 @@ + + + + + + + + + + + parser/array.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/array.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const ArrayExpr = "array";
+const ArrayEntry = "entry";
+
+module.exports = {
+  /**
+   * Parse an array
+   * ```ebnf
+   * array ::= T_ARRAY '(' array_pair_list ')' |
+   *   '[' array_pair_list ']'
+   * ```
+   */
+  read_array: function() {
+    let expect = null;
+    let shortForm = false;
+    const result = this.node(ArrayExpr);
+
+    if (this.token === this.tok.T_ARRAY) {
+      this.next().expect("(");
+      expect = ")";
+    } else {
+      shortForm = true;
+      expect = "]";
+    }
+    let items = [];
+    if (this.next().token !== expect) {
+      items = this.read_array_pair_list(shortForm);
+    }
+    // check non empty entries
+    /*for(let i = 0, size = items.length - 1; i < size; i++) {
+      if (items[i] === null) {
+        this.raiseError(
+          "Cannot use empty array elements in arrays"
+        );
+      }
+    }*/
+    this.expect(expect);
+    this.next();
+    return result(shortForm, items);
+  },
+  /**
+   * Reads an array of items
+   * ```ebnf
+   * array_pair_list ::= array_pair (',' array_pair?)*
+   * ```
+   */
+  read_array_pair_list: function(shortForm) {
+    const self = this;
+    return this.read_list(
+      function() {
+        return self.read_array_pair(shortForm);
+      },
+      ",",
+      true
+    );
+  },
+  /**
+   * Reads an entry
+   * array_pair:
+   *  expr T_DOUBLE_ARROW expr
+   *  | expr
+   *  | expr T_DOUBLE_ARROW '&' variable
+   *  | '&' variable
+   *  | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')'
+   *  | T_LIST '(' array_pair_list ')'
+   */
+  read_array_pair: function(shortForm) {
+    if (
+      this.token === "," ||
+      (!shortForm && this.token === ")") ||
+      (shortForm && this.token === "]")
+    ) {
+      return null;
+    }
+    if (this.token === "&") {
+      return this.next().read_variable(true, false, true);
+    } else {
+      const entry = this.node(ArrayEntry);
+      const expr = this.read_expr();
+      if (this.token === this.tok.T_DOUBLE_ARROW) {
+        if (this.next().token === "&") {
+          return entry(expr, this.next().read_variable(true, false, true));
+        } else {
+          return entry(expr, this.read_expr());
+        }
+      }
+      return expr;
+    }
+  },
+  /**
+   * ```ebnf
+   *  dim_offset ::= expr?
+   * ```
+   */
+  read_dim_offset: function() {
+    if (this.token == "]") return false;
+    return this.read_expr();
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_class.js.html b/parser_class.js.html new file mode 100644 index 000000000..65d3d69b8 --- /dev/null +++ b/parser_class.js.html @@ -0,0 +1,600 @@ + + + + + + + + + + + parser/class.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/class.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * reading a class
+   * ```ebnf
+   * class ::= class_scope? T_CLASS T_STRING (T_EXTENDS NAMESPACE_NAME)? (T_IMPLEMENTS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' CLASS_BODY '}'
+   * ```
+   */
+  read_class: function(flag) {
+    const result = this.node("class");
+    this.expect(this.tok.T_CLASS);
+    this.next().expect(this.tok.T_STRING);
+    const propName = this.text();
+    let propExtends = null;
+    let propImplements = null;
+    if (this.next().token == this.tok.T_EXTENDS) {
+      propExtends = this.next().read_namespace_name();
+    }
+    if (this.token == this.tok.T_IMPLEMENTS) {
+      propImplements = this.next().read_name_list();
+    }
+    this.expect("{");
+    const body = this.next().read_class_body();
+    return result(propName, propExtends, propImplements, body, flag);
+  },
+  /**
+   * Read the class visibility
+   * ```ebnf
+   *   class_scope ::= (T_FINAL | T_ABSTRACT)?
+   * ```
+   */
+  read_class_scope: function() {
+    const result = this.token;
+    if (result == this.tok.T_FINAL) {
+      this.next();
+      return [0, 0, 2];
+    } else if (result == this.tok.T_ABSTRACT) {
+      this.next();
+      return [0, 0, 1];
+    }
+    return [0, 0, 0];
+  },
+  /**
+   * Reads a class body
+   * ```ebnf
+   *   class_body ::= (member_flags? (T_VAR | T_STRING | T_FUNCTION))*
+   * ```
+   */
+  read_class_body: function() {
+    let result = [];
+
+    while (this.token !== this.EOF && this.token !== "}") {
+      if (this.token === this.tok.T_COMMENT) {
+        result.push(this.read_comment());
+        continue;
+      }
+
+      if (this.token === this.tok.T_DOC_COMMENT) {
+        result.push(this.read_doc_comment());
+        continue;
+      }
+
+      // check T_USE trait
+      if (this.token === this.tok.T_USE) {
+        result = result.concat(this.next().read_trait_use_statement());
+        continue;
+      }
+
+      // read member flags
+      const flags = this.read_member_flags(false);
+
+      // check constant
+      if (this.token === this.tok.T_CONST) {
+        const constants = this.read_constant_list(flags);
+        if (this.expect(";")) {
+          this.next();
+        }
+        result = result.concat(constants);
+        continue;
+      }
+
+      // jump over T_VAR then land on T_VARIABLE
+      if (this.token === this.tok.T_VAR) {
+        this.next().expect(this.tok.T_VARIABLE);
+        flags[0] = flags[1] = 0; // public & non static var
+      }
+
+      if (this.token === this.tok.T_VARIABLE) {
+        // reads a variable
+        const variables = this.read_variable_list(flags);
+        this.expect(";");
+        this.next();
+        result = result.concat(variables);
+      } else if (this.token === this.tok.T_FUNCTION) {
+        // reads a function
+        result.push(this.read_function(false, flags));
+      } else {
+        // raise an error
+        this.error([
+          this.tok.T_CONST,
+          this.tok.T_VARIABLE,
+          this.tok.T_FUNCTION
+        ]);
+        // ignore token
+        this.next();
+      }
+    }
+    this.expect("}");
+    this.next();
+    return result;
+  },
+  /**
+   * Reads variable list
+   * ```ebnf
+   *  variable_list ::= (variable_declaration ',')* variable_declaration
+   * ```
+   */
+  read_variable_list: function(flags) {
+    return this.read_list(
+      /**
+       * Reads a variable declaration
+       *
+       * ```ebnf
+       *  variable_declaration ::= T_VARIABLE '=' scalar
+       * ```
+       */
+      function read_variable_declaration() {
+        const result = this.node("property");
+        this.expect(this.tok.T_VARIABLE);
+        const name = this.text().substring(1); // ignore $
+        this.next();
+        if (this.token === ";" || this.token === ",") {
+          return result(name, null, flags);
+        } else if (this.token === "=") {
+          // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L815
+          return result(name, this.next().read_expr(), flags);
+        } else {
+          this.expect([",", ";", "="]);
+          return result(name, null, flags);
+        }
+      },
+      ","
+    );
+  },
+  /**
+   * Reads constant list
+   * ```ebnf
+   *  constant_list ::= T_CONST (constant_declaration ',')* constant_declaration
+   * ```
+   */
+  read_constant_list: function(flags) {
+    if (this.expect(this.tok.T_CONST)) {
+      this.next();
+    }
+    return this.read_list(
+      /**
+       * Reads a constant declaration
+       *
+       * ```ebnf
+       *  constant_declaration ::= (T_STRING | IDENTIFIER) '=' expr
+       * ```
+       * @return {Constant} [:link:](AST.md#constant)
+       */
+      function read_constant_declaration() {
+        const result = this.node("classconstant");
+        let name = null;
+        let value = null;
+        if (
+          this.token === this.tok.T_STRING ||
+          (this.php7 && this.is("IDENTIFIER"))
+        ) {
+          name = this.text();
+          this.next();
+        } else {
+          this.expect("IDENTIFIER");
+        }
+        if (this.expect("=")) {
+          value = this.next().read_expr();
+        }
+        return result(name, value, flags);
+      },
+      ","
+    );
+  },
+  /**
+   * Read member flags
+   * @return array
+   *  1st index : 0 => public, 1 => protected, 2 => private
+   *  2nd index : 0 => instance member, 1 => static member
+   *  3rd index : 0 => normal, 1 => abstract member, 2 => final member
+   */
+  read_member_flags: function(asInterface) {
+    const result = [-1, -1, -1];
+    if (this.is("T_MEMBER_FLAGS")) {
+      let idx = 0,
+        val = 0;
+      do {
+        switch (this.token) {
+          case this.tok.T_PUBLIC:
+            idx = 0;
+            val = 0;
+            break;
+          case this.tok.T_PROTECTED:
+            idx = 0;
+            val = 1;
+            break;
+          case this.tok.T_PRIVATE:
+            idx = 0;
+            val = 2;
+            break;
+          case this.tok.T_STATIC:
+            idx = 1;
+            val = 1;
+            break;
+          case this.tok.T_ABSTRACT:
+            idx = 2;
+            val = 1;
+            break;
+          case this.tok.T_FINAL:
+            idx = 2;
+            val = 2;
+            break;
+        }
+        if (asInterface) {
+          if (idx == 0 && val == 2) {
+            // an interface can't be private
+            this.expect([this.tok.T_PUBLIC, this.tok.T_PROTECTED]);
+            val = -1;
+          } else if (idx == 2 && val == 1) {
+            // an interface cant be abstract
+            this.error();
+            val = -1;
+          }
+        }
+        if (result[idx] !== -1) {
+          // already defined flag
+          this.error();
+        } else if (val !== -1) {
+          result[idx] = val;
+        }
+      } while (this.next().is("T_MEMBER_FLAGS"));
+    }
+
+    if (result[1] == -1) result[1] = 0;
+    if (result[2] == -1) result[2] = 0;
+    return result;
+  },
+  /**
+   * reading an interface
+   * ```ebnf
+   * interface ::= T_INTERFACE T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' INTERFACE_BODY '}'
+   * ```
+   */
+  read_interface: function() {
+    const result = this.node("interface");
+    let name = null;
+    let body = null;
+    let propExtends = null;
+    if (this.expect(this.tok.T_INTERFACE)) {
+      this.next();
+    }
+    if (this.expect(this.tok.T_STRING)) {
+      name = this.text();
+      this.next();
+    }
+    if (this.token === this.tok.T_EXTENDS) {
+      propExtends = this.next().read_name_list();
+    }
+    if (this.expect("{")) {
+      body = this.next().read_interface_body();
+    }
+    return result(name, propExtends, body);
+  },
+  /**
+   * Reads an interface body
+   * ```ebnf
+   *   interface_body ::= (member_flags? (T_CONST | T_FUNCTION))*
+   * ```
+   */
+  read_interface_body: function() {
+    let result = [];
+
+    while (this.token !== this.EOF && this.token !== "}") {
+      if (this.token === this.tok.T_COMMENT) {
+        result.push(this.read_comment());
+        continue;
+      }
+
+      if (this.token === this.tok.T_DOC_COMMENT) {
+        result.push(this.read_doc_comment());
+        continue;
+      }
+
+      // read member flags
+      const flags = this.read_member_flags(true);
+
+      // check constant
+      if (this.token == this.tok.T_CONST) {
+        const constants = this.read_constant_list(flags);
+        if (this.expect(";")) {
+          this.next();
+        }
+        result = result.concat(constants);
+      } else if (this.token === this.tok.T_FUNCTION) {
+        // reads a function
+        const method = this.read_function_declaration(2, flags);
+        method.parseFlags(flags);
+        result.push(method);
+        if (this.expect(";")) {
+          this.next();
+        }
+      } else {
+        // raise an error
+        this.error([this.tok.T_CONST, this.tok.T_FUNCTION]);
+        this.next();
+      }
+    }
+    if (this.expect("}")) {
+      this.next();
+    }
+    return result;
+  },
+  /**
+   * reading a trait
+   * ```ebnf
+   * trait ::= T_TRAIT T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' FUNCTION* '}'
+   * ```
+   */
+  read_trait: function() {
+    const result = this.node("trait");
+    let propName = null;
+    let propExtends = null;
+    let propImplements = null;
+    let body = null;
+    if (this.expect(this.tok.T_TRAIT)) {
+      this.next();
+    }
+    if (this.expect(this.tok.T_STRING)) {
+      propName = this.text();
+    }
+    if (this.next().token == this.tok.T_EXTENDS) {
+      propExtends = this.next().read_namespace_name();
+    }
+    if (this.token == this.tok.T_IMPLEMENTS) {
+      propImplements = this.next().read_name_list();
+    }
+    if (this.expect("{")) {
+      body = this.next().read_class_body();
+    }
+    return result(propName, propExtends, propImplements, body);
+  },
+  /**
+   * reading a use statement
+   * ```ebnf
+   * trait_use_statement ::= namespace_name (',' namespace_name)* ('{' trait_use_alias '}')?
+   * ```
+   */
+  read_trait_use_statement: function() {
+    // defines use statements
+    const node = this.node("traituse");
+    const traits = [this.read_namespace_name()];
+    let adaptations = null;
+    while (this.token === ",") {
+      traits.push(this.next().read_namespace_name());
+    }
+    if (this.token === "{") {
+      adaptations = [];
+      // defines alias statements
+      while (this.next().token !== this.EOF) {
+        if (this.token === "}") break;
+        adaptations.push(this.read_trait_use_alias());
+        this.expect(";");
+      }
+      if (this.expect("}")) {
+        this.next();
+      }
+    } else {
+      if (this.expect(";")) {
+        this.next();
+      }
+    }
+    return node(traits, adaptations);
+  },
+  /**
+   * Reading trait alias
+   * ```ebnf
+   * trait_use_alias ::= namespace_name ( T_DOUBLE_COLON T_STRING )? (T_INSTEADOF namespace_name) | (T_AS member_flags? T_STRING)
+   * ```
+   * name list : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L303
+   * trait adaptation : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L742
+   */
+  read_trait_use_alias: function() {
+    const node = this.node();
+    let trait = null;
+    let method;
+
+    if (this.is("IDENTIFIER")) {
+      method = this.text();
+      this.next();
+    } else {
+      method = this.read_namespace_name();
+
+      if (this.token === this.tok.T_DOUBLE_COLON) {
+        this.next();
+        if (
+          this.token === this.tok.T_STRING ||
+          (this.php7 && this.is("IDENTIFIER"))
+        ) {
+          trait = method;
+          method = this.text();
+          this.next();
+        } else {
+          this.expect(this.tok.T_STRING);
+        }
+      } else {
+        // convert identifier as string
+        method = method.name;
+      }
+    }
+
+    // handle trait precedence
+    if (this.token === this.tok.T_INSTEADOF) {
+      return node(
+        "traitprecedence",
+        trait,
+        method,
+        this.next().read_name_list()
+      );
+    } else if (this.token === this.tok.T_AS) {
+      // handle trait alias
+      let flags = null;
+      let alias = null;
+      if (this.next().is("T_MEMBER_FLAGS")) {
+        flags = this.read_member_flags();
+      }
+
+      if (
+        this.token === this.tok.T_STRING ||
+        (this.php7 && this.is("IDENTIFIER"))
+      ) {
+        alias = this.text();
+        this.next();
+      } else if (flags === false) {
+        // no visibility flags and no name => too bad
+        this.expect(this.tok.T_STRING);
+      }
+
+      return node("traitalias", trait, method, alias, flags);
+    }
+
+    // handle errors
+    this.expect([this.tok.T_AS, this.tok.T_INSTEADOF]);
+    return node("traitalias", trait, method, null, null);
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_comment.js.html b/parser_comment.js.html new file mode 100644 index 000000000..d89a7c2e8 --- /dev/null +++ b/parser_comment.js.html @@ -0,0 +1,187 @@ + + + + + + + + + + + parser/comment.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/comment.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   *  Comments with // or # or / * ... * /
+   */
+  read_comment: function() {
+    const text = this.text();
+    let result = this.ast.prepare(
+      text.substring(0, 2) === "/*" ? "commentblock" : "commentline",
+      null,
+      this
+    );
+    // handle location on comment
+    const prev = this.prev;
+    this.prev = [
+      this.lexer.yylloc.last_line,
+      this.lexer.yylloc.last_column,
+      this.lexer.offset
+    ];
+    this.lex();
+    result = result(text);
+    this.prev = prev;
+    return result;
+  },
+  /**
+   * Comments with / ** ... * /
+   */
+  read_doc_comment: function() {
+    let result = this.ast.prepare("commentblock", null, this);
+    const text = this.text();
+    const prev = this.prev;
+    this.prev = [
+      this.lexer.yylloc.last_line,
+      this.lexer.yylloc.last_column,
+      this.lexer.offset
+    ];
+    this.lex();
+    result = result(text);
+    this.prev = prev;
+    return result;
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_expr.js.html b/parser_expr.js.html new file mode 100644 index 000000000..8e48d1643 --- /dev/null +++ b/parser_expr.js.html @@ -0,0 +1,659 @@ + + + + + + + + + + + parser/expr.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/expr.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  read_expr: function() {
+    const result = this.node();
+    const expr = this.read_expr_item();
+    // binary operations
+    if (this.token === "|")
+      return result("bin", "|", expr, this.next().read_expr());
+    if (this.token === "&")
+      return result("bin", "&", expr, this.next().read_expr());
+    if (this.token === "^")
+      return result("bin", "^", expr, this.next().read_expr());
+    if (this.token === ".")
+      return result("bin", ".", expr, this.next().read_expr());
+    if (this.token === "+")
+      return result("bin", "+", expr, this.next().read_expr());
+    if (this.token === "-")
+      return result("bin", "-", expr, this.next().read_expr());
+    if (this.token === "*")
+      return result("bin", "*", expr, this.next().read_expr());
+    if (this.token === "/")
+      return result("bin", "/", expr, this.next().read_expr());
+    if (this.token === "%")
+      return result("bin", "%", expr, this.next().read_expr());
+    if (this.token === this.tok.T_POW)
+      return result("bin", "**", expr, this.next().read_expr());
+    if (this.token === this.tok.T_SL)
+      return result("bin", "<<", expr, this.next().read_expr());
+    if (this.token === this.tok.T_SR)
+      return result("bin", ">>", expr, this.next().read_expr());
+    // more binary operations (formerly bool)
+    if (this.token === this.tok.T_BOOLEAN_OR)
+      return result("bin", "||", expr, this.next().read_expr());
+    if (this.token === this.tok.T_LOGICAL_OR)
+      return result("bin", "or", expr, this.next().read_expr());
+    if (this.token === this.tok.T_BOOLEAN_AND)
+      return result("bin", "&&", expr, this.next().read_expr());
+    if (this.token === this.tok.T_LOGICAL_AND)
+      return result("bin", "and", expr, this.next().read_expr());
+    if (this.token === this.tok.T_LOGICAL_XOR)
+      return result("bin", "xor", expr, this.next().read_expr());
+    if (this.token === this.tok.T_IS_IDENTICAL)
+      return result("bin", "===", expr, this.next().read_expr());
+    if (this.token === this.tok.T_IS_NOT_IDENTICAL)
+      return result("bin", "!==", expr, this.next().read_expr());
+    if (this.token === this.tok.T_IS_EQUAL)
+      return result("bin", "==", expr, this.next().read_expr());
+    if (this.token === this.tok.T_IS_NOT_EQUAL)
+      return result("bin", "!=", expr, this.next().read_expr());
+    if (this.token === "<")
+      return result("bin", "<", expr, this.next().read_expr());
+    if (this.token === ">")
+      return result("bin", ">", expr, this.next().read_expr());
+    if (this.token === this.tok.T_IS_SMALLER_OR_EQUAL)
+      return result("bin", "<=", expr, this.next().read_expr());
+    if (this.token === this.tok.T_IS_GREATER_OR_EQUAL)
+      return result("bin", ">=", expr, this.next().read_expr());
+    if (this.token === this.tok.T_SPACESHIP)
+      return result("bin", "<=>", expr, this.next().read_expr());
+    if (this.token === this.tok.T_INSTANCEOF)
+      return result("bin", "instanceof", expr, this.next().read_expr());
+
+    // extra operations :
+    // $username = $_GET['user'] ?? 'nobody';
+    if (this.token === this.tok.T_COALESCE)
+      return result("bin", "??", expr, this.next().read_expr());
+
+    // extra operations :
+    // $username = $_GET['user'] ? true : false;
+    if (this.token === "?") {
+      let trueArg = null;
+      if (this.next().token !== ":") {
+        trueArg = this.read_expr();
+      }
+      this.expect(":") && this.next();
+      return result("retif", expr, trueArg, this.read_expr());
+    }
+
+    return expr;
+  },
+
+  /**
+   * Reads a cast expression
+   */
+  read_expr_cast: function(type) {
+    return this.node("cast")(type, this.text(), this.next().read_expr());
+  },
+
+  /**
+   * ```ebnf
+   * Reads an expression
+   *  expr ::= @todo
+   * ```
+   */
+  read_expr_item: function() {
+    let result, expr;
+    if (this.token === "@") return this.node("silent")(this.next().read_expr());
+    if (this.token === "+")
+      return this.node("unary")("+", this.next().read_expr());
+    if (this.token === "!")
+      return this.node("unary")("!", this.next().read_expr());
+    if (this.token === "~")
+      return this.node("unary")("~", this.next().read_expr());
+
+    if (this.token === "-") {
+      result = this.node();
+      this.next();
+      if (
+        this.token === this.tok.T_LNUMBER ||
+        this.token === this.tok.T_DNUMBER
+      ) {
+        // negative number
+        result = result("number", "-" + this.text(), null);
+        this.next();
+        return result;
+      } else {
+        return result("unary", "-", this.read_expr());
+      }
+    }
+
+    if (this.token === "(") {
+      expr = this.next().read_expr();
+      expr.parenthesizedExpression = true;
+      this.expect(")") && this.next();
+      return this.handleDereferencable(expr);
+    }
+
+    if (this.token === "`") {
+      // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1048
+      return this.next().read_encapsed_string("`");
+    }
+
+    if (this.token === this.tok.T_LIST) {
+      let assign = null;
+      const isInner = this.innerList;
+      result = this.node("list");
+      if (!isInner) {
+        assign = this.node("assign");
+      }
+      if (this.next().expect("(")) {
+        this.next();
+      }
+
+      if (!this.innerList) this.innerList = true;
+
+      // reads inner items
+      const assignList = this.read_array_pair_list(false);
+      if (this.expect(")")) {
+        this.next();
+      }
+
+      // check if contains at least one assignment statement
+      let hasItem = false;
+      for (let i = 0; i < assignList.length; i++) {
+        if (assignList[i] !== null) {
+          hasItem = true;
+          break;
+        }
+      }
+      if (!hasItem) {
+        this.raiseError(
+          "Fatal Error :  Cannot use empty list on line " +
+            this.lexer.yylloc.first_line
+        );
+      }
+
+      // handles the node resolution
+      if (!isInner) {
+        this.innerList = false;
+        if (this.expect("=")) {
+          return assign(
+            result(assignList, false),
+            this.next().read_expr(),
+            "="
+          );
+        } else {
+          // error fallback : list($a, $b);
+          return result(assignList, false);
+        }
+      } else {
+        return result(assignList, false);
+      }
+    }
+
+    if (this.token === this.tok.T_CLONE)
+      return this.node("clone")(this.next().read_expr());
+
+    switch (this.token) {
+      case this.tok.T_INC:
+        return this.node("pre")(
+          "+",
+          this.next().read_variable(false, false, false)
+        );
+
+      case this.tok.T_DEC:
+        return this.node("pre")(
+          "-",
+          this.next().read_variable(false, false, false)
+        );
+
+      case this.tok.T_NEW:
+        return this.next().read_new_expr();
+
+      case this.tok.T_ISSET: {
+        result = this.node("isset");
+        if (this.next().expect("(")) {
+          this.next();
+        }
+        const args = this.read_list(this.read_expr, ",");
+        if (this.expect(")")) {
+          this.next();
+        }
+        return result(args);
+      }
+      case this.tok.T_EMPTY: {
+        result = this.node("empty");
+        if (this.next().expect("(")) {
+          this.next();
+        }
+        const arg = this.read_expr();
+        if (this.expect(")")) {
+          this.next();
+        }
+        return result([arg]);
+      }
+      case this.tok.T_INCLUDE:
+        return this.node("include")(false, false, this.next().read_expr());
+
+      case this.tok.T_INCLUDE_ONCE:
+        return this.node("include")(true, false, this.next().read_expr());
+
+      case this.tok.T_REQUIRE:
+        return this.node("include")(false, true, this.next().read_expr());
+
+      case this.tok.T_REQUIRE_ONCE:
+        return this.node("include")(true, true, this.next().read_expr());
+
+      case this.tok.T_EVAL:
+        result = this.node("eval");
+        if (this.next().expect("(")) {
+          this.next();
+        }
+        expr = this.read_expr();
+        if (this.expect(")")) {
+          this.next();
+        }
+        return result(expr);
+
+      case this.tok.T_INT_CAST:
+        return this.read_expr_cast("int");
+
+      case this.tok.T_DOUBLE_CAST:
+        return this.read_expr_cast("float");
+
+      case this.tok.T_STRING_CAST:
+        return this.read_expr_cast(
+          this.text().indexOf("binary") !== -1 ? "binary" : "string"
+        );
+
+      case this.tok.T_ARRAY_CAST:
+        return this.read_expr_cast("array");
+
+      case this.tok.T_OBJECT_CAST:
+        return this.read_expr_cast("object");
+
+      case this.tok.T_BOOL_CAST:
+        return this.read_expr_cast("bool");
+
+      case this.tok.T_UNSET_CAST:
+        return this.read_expr_cast("unset");
+
+      case this.tok.T_EXIT: {
+        const useDie = this.lexer.yytext.toLowerCase() === "die";
+        result = this.node("exit");
+        let status = null;
+        if (this.next().token === "(") {
+          if (this.next().token !== ")") {
+            status = this.read_expr();
+            if (this.expect(")")) {
+              this.next();
+            }
+          } else {
+            this.next();
+          }
+        }
+        return result(status, useDie);
+      }
+
+      case this.tok.T_PRINT:
+        return this.node("print")(this.next().read_expr());
+
+      // T_YIELD (expr (T_DOUBLE_ARROW expr)?)?
+      case this.tok.T_YIELD: {
+        let value = null;
+        let key = null;
+        result = this.node("yield");
+        if (this.next().is("EXPR")) {
+          // reads the yield return value
+          value = this.read_expr();
+          if (this.token === this.tok.T_DOUBLE_ARROW) {
+            // reads the yield returned key
+            key = value;
+            value = this.next().read_expr();
+          }
+        }
+        return result(value, key);
+      }
+
+      // T_YIELD_FROM expr
+      case this.tok.T_YIELD_FROM:
+        result = this.node("yieldfrom");
+        expr = this.next().read_expr();
+        return result(expr);
+
+      case this.tok.T_FUNCTION:
+        return this.read_function(true);
+
+      case this.tok.T_STATIC: {
+        const backup = [this.token, this.lexer.getState()];
+        if (this.next().token === this.tok.T_FUNCTION) {
+          // handles static function
+          return this.read_function(true, [0, 1, 0]);
+        } else {
+          // rollback
+          this.lexer.tokens.push(backup);
+          this.next();
+        }
+      }
+    }
+
+    // SCALAR | VARIABLE
+    if (this.is("VARIABLE")) {
+      result = this.node();
+      expr = this.read_variable(false, false, false);
+
+      // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L877
+      // should accept only a variable
+      const isConst =
+        expr.kind === "constref" ||
+        (expr.kind === "staticlookup" && expr.offset.kind === "constref");
+
+      // VARIABLES SPECIFIC OPERATIONS
+      switch (this.token) {
+        case "=": {
+          if (isConst) this.error("VARIABLE");
+          let right;
+          if (this.next().token == "&") {
+            if (this.next().token === this.tok.T_NEW) {
+              right = this.next().read_new_expr();
+            } else {
+              right = this.read_variable(false, false, true);
+            }
+          } else {
+            right = this.read_expr();
+          }
+          return result("assign", expr, right, "=");
+        }
+
+        // operations :
+        case this.tok.T_PLUS_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "+=");
+
+        case this.tok.T_MINUS_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "-=");
+
+        case this.tok.T_MUL_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "*=");
+
+        case this.tok.T_POW_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "**=");
+
+        case this.tok.T_DIV_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "/=");
+
+        case this.tok.T_CONCAT_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), ".=");
+
+        case this.tok.T_MOD_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "%=");
+
+        case this.tok.T_AND_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "&=");
+
+        case this.tok.T_OR_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "|=");
+
+        case this.tok.T_XOR_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "^=");
+
+        case this.tok.T_SL_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), "<<=");
+
+        case this.tok.T_SR_EQUAL:
+          if (isConst) this.error("VARIABLE");
+          return result("assign", expr, this.next().read_expr(), ">>=");
+
+        case this.tok.T_INC:
+          if (isConst) this.error("VARIABLE");
+          this.next();
+          return result("post", "+", expr);
+        case this.tok.T_DEC:
+          if (isConst) this.error("VARIABLE");
+          this.next();
+          return result("post", "-", expr);
+      }
+    } else if (this.is("SCALAR")) {
+      result = this.node();
+      expr = this.read_scalar();
+      if (expr.kind === "array" && expr.shortForm && this.token === "=") {
+        // list assign
+        let list = this.node("list")(expr.items, true);
+        if (expr.loc) list.loc = expr.loc;
+        let right = this.next().read_expr();
+        return result("assign", list, right, "=");
+      }
+      // classic array
+      return this.handleDereferencable(expr);
+    } else {
+      this.error("EXPR");
+      this.next();
+    }
+
+    // returns variable | scalar
+    return expr;
+  },
+  /**
+   * ```ebnf
+   *    new_expr ::= T_NEW (namespace_name function_argument_list) | (T_CLASS ... class declaration)
+   * ```
+   * https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L850
+   */
+  read_new_expr: function() {
+    const result = this.node("new");
+    let args = [];
+    if (this.token === this.tok.T_CLASS) {
+      const what = this.node("class");
+      // Annonymous class declaration
+      let propExtends = null,
+        propImplements = null,
+        body = null;
+      if (this.next().token === "(") {
+        args = this.read_function_argument_list();
+      }
+      if (this.token == this.tok.T_EXTENDS) {
+        propExtends = this.next().read_namespace_name();
+      }
+      if (this.token == this.tok.T_IMPLEMENTS) {
+        propImplements = this.next().read_name_list();
+      }
+      if (this.expect("{")) {
+        body = this.next().read_class_body();
+      }
+      return result(
+        what(null, propExtends, propImplements, body, [0, 0, 0]),
+        args
+      );
+    }
+    // Already existing class
+    const name = this.read_class_name_reference();
+    if (this.token === "(") {
+      args = this.read_function_argument_list();
+    }
+    return result(name, args);
+  },
+  /**
+   * Reads a class name
+   * ```ebnf
+   * class_name_reference ::= namespace_name | variable
+   * ```
+   */
+  read_class_name_reference: function() {
+    if (
+      this.token === this.tok.T_NS_SEPARATOR ||
+      this.token === this.tok.T_STRING ||
+      this.token === this.tok.T_NAMESPACE
+    ) {
+      let result = this.read_namespace_name();
+      if (this.token === this.tok.T_DOUBLE_COLON) {
+        result = this.read_static_getter(result);
+      }
+      return result;
+    } else if (this.is("VARIABLE")) {
+      return this.read_variable(true, false, false);
+    } else {
+      this.expect([this.tok.T_STRING, "VARIABLE"]);
+    }
+  },
+  handleDereferencable: function(expr) {
+    while (this.token !== this.EOF) {
+      if (this.token === this.tok.T_OBJECT_OPERATOR) {
+        expr = this.recursive_variable_chain_scan(expr, false);
+      } else if (this.token === this.tok.T_CURLY_OPEN || this.token === "[") {
+        expr = this.read_dereferencable(expr);
+      } else if (this.token === "(") {
+        // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1118
+        expr = this.node("call")(expr, this.read_function_argument_list());
+      } else {
+        return expr;
+      }
+    }
+    return expr;
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_function.js.html b/parser_function.js.html new file mode 100644 index 000000000..ff1edf324 --- /dev/null +++ b/parser_function.js.html @@ -0,0 +1,396 @@ + + + + + + + + + + + parser/function.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/function.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * checks if current token is a reference keyword
+   */
+  is_reference: function() {
+    if (this.token == "&") {
+      this.next();
+      return true;
+    }
+    return false;
+  },
+  /**
+   * checks if current token is a variadic keyword
+   */
+  is_variadic: function() {
+    if (this.token === this.tok.T_ELLIPSIS) {
+      this.next();
+      return true;
+    }
+    return false;
+  },
+  /**
+   * reading a function
+   * ```ebnf
+   * function ::= function_declaration code_block
+   * ```
+   */
+  read_function: function(closure, flag) {
+    const result = this.read_function_declaration(
+      closure ? 1 : flag ? 2 : 0,
+      flag && flag[1] === 1
+    );
+    if (flag && flag[2] == 1) {
+      // abstract function :
+      result.parseFlags(flag);
+      if (this.expect(";")) {
+        this.next();
+      }
+    } else {
+      if (this.expect("{")) {
+        result.body = this.read_code_block(false);
+        if (result.loc && result.body.loc) {
+          result.loc.end = result.body.loc.end;
+        }
+      }
+      if (!closure && flag) {
+        result.parseFlags(flag);
+      }
+    }
+    return result;
+  },
+  /**
+   * reads a function declaration (without his body)
+   * ```ebnf
+   * function_declaration ::= T_FUNCTION '&'?  T_STRING '(' parameter_list ')'
+   * ```
+   */
+  read_function_declaration: function(type, isStatic) {
+    let nodeName = "function";
+    if (type === 1) {
+      nodeName = "closure";
+    } else if (type === 2) {
+      nodeName = "method";
+    }
+    const result = this.node(nodeName);
+
+    if (this.expect(this.tok.T_FUNCTION)) {
+      this.next();
+    }
+    const isRef = this.is_reference();
+    let name = false,
+      use = [],
+      returnType = null,
+      nullable = false;
+    if (type !== 1) {
+      if (type === 2) {
+        if (
+          this.token === this.tok.T_STRING ||
+          (this.php7 && this.is("IDENTIFIER"))
+        ) {
+          name = this.text();
+          this.next();
+        } else {
+          this.error("IDENTIFIER");
+        }
+      } else {
+        if (this.expect(this.tok.T_STRING)) {
+          name = this.text();
+        }
+        this.next();
+      }
+    }
+    if (this.expect("(")) this.next();
+    const params = this.read_parameter_list();
+    if (this.expect(")")) this.next();
+    if (type === 1 && this.token === this.tok.T_USE) {
+      if (this.next().expect("(")) this.next();
+      use = this.read_list(this.read_lexical_var, ",");
+      if (this.expect(")")) this.next();
+    }
+    if (this.token === ":") {
+      if (this.next().token === "?") {
+        nullable = true;
+        this.next();
+      }
+      returnType = this.read_type();
+    }
+    if (type === 1) {
+      // closure
+      return result(params, isRef, use, returnType, nullable, isStatic);
+    }
+    return result(name, params, isRef, returnType, nullable);
+  },
+  /**
+   * ```ebnf
+   * lexical_var ::= '&'? T_VARIABLE
+   * ```
+   */
+  read_lexical_var: function() {
+    const result = this.node("variable");
+    let isRef = false;
+    if (this.token === "&") {
+      isRef = true;
+      this.next();
+    }
+    this.expect(this.tok.T_VARIABLE);
+    const name = this.text().substring(1);
+    this.next();
+    return result(name, isRef, false);
+  },
+  /**
+   * reads a list of parameters
+   * ```ebnf
+   *  parameter_list ::= (parameter ',')* parameter?
+   * ```
+   */
+  read_parameter_list: function() {
+    const result = [];
+    if (this.token != ")") {
+      while (this.token != this.EOF) {
+        result.push(this.read_parameter());
+        if (this.token == ",") {
+          this.next();
+        } else if (this.token == ")") {
+          break;
+        } else {
+          this.error([",", ")"]);
+          break;
+        }
+      }
+    }
+    return result;
+  },
+  /**
+   * ```ebnf
+   *  parameter ::= type? '&'? T_ELLIPSIS? T_VARIABLE ('=' expr)?
+   * ```
+   * @see https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L640
+   */
+  read_parameter: function() {
+    const node = this.node("parameter");
+    let name = null;
+    let value = null;
+    let type = null;
+    let nullable = false;
+    if (this.token === "?") {
+      this.next();
+      nullable = true;
+    }
+    type = this.read_type();
+    if (nullable && !type) {
+      this.raiseError(
+        "Expecting a type definition combined with nullable operator"
+      );
+    }
+    const isRef = this.is_reference();
+    const isVariadic = this.is_variadic();
+    if (this.expect(this.tok.T_VARIABLE)) {
+      name = this.text().substring(1);
+      this.next();
+    }
+    if (this.token == "=") {
+      value = this.next().read_expr();
+    }
+    return node(name, type, value, isRef, isVariadic, nullable);
+  },
+  /**
+   * Reads a list of arguments
+   * ```ebnf
+   *  function_argument_list ::= '(' (argument_list (',' argument_list)*)? ')'
+   * ```
+   */
+  read_function_argument_list: function() {
+    const result = [];
+    let wasVariadic = false;
+    this.expect("(") && this.next();
+    if (this.token !== ")") {
+      while (this.token != this.EOF) {
+        const argument = this.read_argument_list();
+        if (argument) {
+          result.push(argument);
+          if (argument.kind === "variadic") {
+            wasVariadic = true;
+          } else if (wasVariadic) {
+            this.raiseError("Unexpected argument after a variadic argument");
+          }
+        }
+        if (this.token === ",") {
+          this.next();
+        } else break;
+      }
+    }
+    this.expect(")") && this.next();
+    return result;
+  },
+  /**
+   * ```ebnf
+   *    argument_list ::= T_ELLIPSIS? expr
+   * ```
+   */
+  read_argument_list: function() {
+    if (this.token === this.tok.T_ELLIPSIS) {
+      return this.node("variadic")(this.next().read_expr());
+    }
+    return this.read_expr();
+  },
+  /**
+   * read type hinting
+   * ```ebnf
+   *  type ::= T_ARRAY | T_CALLABLE | namespace_name
+   * ```
+   */
+  read_type: function() {
+    const result = this.node("identifier");
+    switch (this.token) {
+      case this.tok.T_ARRAY:
+        this.next();
+        return result(["", "array"], false);
+      case this.tok.T_NAMESPACE:
+      case this.tok.T_NS_SEPARATOR:
+      case this.tok.T_STRING:
+        return this.read_namespace_name();
+      case this.tok.T_CALLABLE:
+        this.next();
+        return result(["", "callable"], false);
+      default:
+        return null;
+    }
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_if.js.html b/parser_if.js.html new file mode 100644 index 000000000..ecf3f4647 --- /dev/null +++ b/parser_if.js.html @@ -0,0 +1,237 @@ + + + + + + + + + + + parser/if.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/if.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * Reads an IF statement
+   *
+   * ```ebnf
+   *  if ::= T_IF '(' expr ')' ':' ...
+   * ```
+   */
+  read_if: function() {
+    const result = this.node("if");
+    let body = null;
+    let alternate = null;
+    let shortForm = false;
+    let test = null;
+    test = this.next().read_if_expr();
+
+    if (this.token === ":") {
+      shortForm = true;
+      this.next();
+      body = this.node("block");
+      const items = [];
+      while (this.token !== this.EOF && this.token !== this.tok.T_ENDIF) {
+        if (this.token === this.tok.T_ELSEIF) {
+          alternate = this.read_elseif_short();
+          break;
+        } else if (this.token === this.tok.T_ELSE) {
+          alternate = this.read_else_short();
+          break;
+        }
+        items.push(this.read_inner_statement());
+      }
+      body = body(null, items);
+      this.expect(this.tok.T_ENDIF) && this.next();
+      this.expectEndOfStatement();
+    } else {
+      body = this.read_statement();
+      if (this.token === this.tok.T_ELSEIF) {
+        alternate = this.read_if();
+      } else if (this.token === this.tok.T_ELSE) {
+        alternate = this.next().read_statement();
+      }
+    }
+    return result(test, body, alternate, shortForm);
+  },
+  /**
+   * reads an if expression : '(' expr ')'
+   */
+  read_if_expr: function() {
+    this.expect("(") && this.next();
+    const result = this.read_expr();
+    this.expect(")") && this.next();
+    return result;
+  },
+  /**
+   * reads an elseif (expr): statements
+   */
+  read_elseif_short: function() {
+    const result = this.node("if");
+    let alternate = null;
+    let test = null;
+    let body = null;
+    const items = [];
+    test = this.next().read_if_expr();
+    if (this.expect(":")) this.next();
+    body = this.node("block");
+    while (this.token != this.EOF && this.token !== this.tok.T_ENDIF) {
+      if (this.token === this.tok.T_ELSEIF) {
+        alternate = this.read_elseif_short();
+        break;
+      } else if (this.token === this.tok.T_ELSE) {
+        alternate = this.read_else_short();
+        break;
+      }
+      items.push(this.read_inner_statement());
+    }
+    body = body(null, items);
+    return result(test, body, alternate, true);
+  },
+  /**
+   *
+   */
+  read_else_short: function() {
+    const body = this.node("block");
+    if (this.next().expect(":")) this.next();
+    const items = [];
+    while (this.token != this.EOF && this.token !== this.tok.T_ENDIF) {
+      items.push(this.read_inner_statement());
+    }
+    return body(null, items);
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_loops.js.html b/parser_loops.js.html new file mode 100644 index 000000000..cb760801b --- /dev/null +++ b/parser_loops.js.html @@ -0,0 +1,303 @@ + + + + + + + + + + + parser/loops.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/loops.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * Reads a while statement
+   * ```ebnf
+   * while ::= T_WHILE (statement | ':' inner_statement_list T_ENDWHILE ';')
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L587
+   * @return {While}
+   */
+  read_while: function() {
+    const result = this.node("while");
+    let test = null;
+    let body = null;
+    let shortForm = false;
+    if (this.expect("(")) this.next();
+    test = this.read_expr();
+    if (this.expect(")")) this.next();
+    if (this.token === ":") {
+      shortForm = true;
+      body = this.read_short_form(this.tok.T_ENDWHILE);
+    } else {
+      body = this.read_statement();
+    }
+    return result(test, body, shortForm);
+  },
+  /**
+   * Reads a do / while loop
+   * ```ebnf
+   * do ::= T_DO statement T_WHILE '(' expr ')' ';'
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L423
+   * @return {Do}
+   */
+  read_do: function() {
+    const result = this.node("do");
+    let test = null;
+    let body = null;
+    body = this.read_statement();
+    if (this.expect(this.tok.T_WHILE)) {
+      if (this.next().expect("(")) this.next();
+      test = this.read_expr();
+      if (this.expect(")")) this.next();
+      if (this.expect(";")) this.next();
+    }
+    return result(test, body);
+  },
+  /**
+   * Read a for incremental loop
+   * ```ebnf
+   * for ::= T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement
+   * for_statement ::= statement | ':' inner_statement_list T_ENDFOR ';'
+   * for_exprs ::= expr? (',' expr)*
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L425
+   * @return {For}
+   */
+  read_for: function() {
+    const result = this.node("for");
+    let init = [];
+    let test = [];
+    let increment = [];
+    let body = null;
+    let shortForm = false;
+    if (this.expect("(")) this.next();
+    if (this.token !== ";") {
+      init = this.read_list(this.read_expr, ",");
+      if (this.expect(";")) this.next();
+    } else {
+      this.next();
+    }
+    if (this.token !== ";") {
+      test = this.read_list(this.read_expr, ",");
+      if (this.expect(";")) this.next();
+    } else {
+      this.next();
+    }
+    if (this.token !== ")") {
+      increment = this.read_list(this.read_expr, ",");
+      if (this.expect(")")) this.next();
+    } else {
+      this.next();
+    }
+    if (this.token === ":") {
+      shortForm = true;
+      body = this.read_short_form(this.tok.T_ENDFOR);
+    } else {
+      body = this.read_statement();
+    }
+    return result(init, test, increment, body, shortForm);
+  },
+  /**
+   * Reads a foreach loop
+   * ```ebnf
+   * foreach ::= '(' expr T_AS foreach_variable (T_DOUBLE_ARROW foreach_variable)? ')' statement
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L438
+   * @return {Foreach}
+   */
+  read_foreach: function() {
+    const result = this.node("foreach");
+    let source = null;
+    let key = null;
+    let value = null;
+    let body = null;
+    let shortForm = false;
+    if (this.expect("(")) this.next();
+    source = this.read_expr();
+    if (this.expect(this.tok.T_AS)) {
+      this.next();
+      value = this.read_foreach_variable();
+      if (this.token === this.tok.T_DOUBLE_ARROW) {
+        key = value;
+        value = this.next().read_foreach_variable();
+      }
+    }
+
+    // grammatically correct but not supported by PHP
+    if (key && key.kind === "list") {
+      this.raiseError("Fatal Error : Cannot use list as key element");
+    }
+
+    if (this.expect(")")) this.next();
+
+    if (this.token === ":") {
+      shortForm = true;
+      body = this.read_short_form(this.tok.T_ENDFOREACH);
+    } else {
+      body = this.read_statement();
+    }
+    return result(source, key, value, body, shortForm);
+  },
+  /**
+   * Reads a foreach variable statement
+   * ```ebnf
+   * foreach_variable =
+   *    variable |
+   *    '&' variable |
+   *    T_LIST '(' assignment_list ')' |
+   *    '[' assignment_list ']'
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L544
+   * @return {Expression}
+   */
+  read_foreach_variable: function() {
+    if (this.token === this.tok.T_LIST || this.token === "[") {
+      const isShort = this.token === "[";
+      const result = this.node("list");
+      this.next();
+      if (!isShort && this.expect("(")) this.next();
+      const assignList = this.read_array_pair_list(isShort);
+      if (this.expect(isShort ? "]" : ")")) this.next();
+      return result(assignList, isShort);
+    } else {
+      return this.read_variable(false, false, false);
+    }
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_main.js.html b/parser_main.js.html new file mode 100644 index 000000000..614c23f56 --- /dev/null +++ b/parser_main.js.html @@ -0,0 +1,160 @@ + + + + + + + + + + + parser/main.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/main.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * ```ebnf
+   * start ::= (namespace | top_statement)*
+   * ```
+   */
+  read_start: function() {
+    if (this.token == this.tok.T_NAMESPACE) {
+      return this.read_namespace();
+    } else {
+      return this.read_top_statement();
+    }
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_namespace.js.html b/parser_namespace.js.html new file mode 100644 index 000000000..a26855570 --- /dev/null +++ b/parser_namespace.js.html @@ -0,0 +1,311 @@ + + + + + + + + + + + parser/namespace.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/namespace.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * Reads a namespace declaration block
+   * ```ebnf
+   * namespace ::= T_NAMESPACE namespace_name? '{'
+   *    top_statements
+   * '}'
+   * | T_NAMESPACE namespace_name ';' top_statements
+   * ```
+   * @see http://php.net/manual/en/language.namespaces.php
+   * @return {Namespace}
+   */
+  read_namespace: function() {
+    const result = this.node("namespace");
+    let body;
+    this.expect(this.tok.T_NAMESPACE) && this.next();
+    if (this.token == "{") {
+      this.currentNamespace = [""];
+      body = this.next().read_top_statements();
+      this.expect("}") && this.next();
+      return result([""], body, true);
+    } else {
+      const name = this.read_namespace_name();
+      if (this.token == ";") {
+        this.currentNamespace = name;
+        body = this.next().read_top_statements();
+        this.expect(this.EOF);
+        return result(name.name, body, false);
+      } else if (this.token == "{") {
+        this.currentNamespace = name;
+        body = this.next().read_top_statements();
+        this.expect("}") && this.next();
+        return result(name.name, body, true);
+      } else if (this.token === "(") {
+        // resolve ambuiguity between namespace & function call
+        name.resolution = this.ast.identifier.RELATIVE_NAME;
+        name.name = name.name.substring(1);
+        return this.node("call")(name, this.read_function_argument_list());
+      } else {
+        this.error(["{", ";"]);
+        // graceful mode :
+        this.currentNamespace = name;
+        body = this.read_top_statements();
+        this.expect(this.EOF);
+        return result(name, body, false);
+      }
+    }
+  },
+  /**
+   * Reads a namespace name
+   * ```ebnf
+   *  namespace_name ::= T_NS_SEPARATOR? (T_STRING T_NS_SEPARATOR)* T_STRING
+   * ```
+   * @see http://php.net/manual/en/language.namespaces.rules.php
+   * @return {Identifier}
+   */
+  read_namespace_name: function() {
+    const result = this.node("identifier");
+    let relative = false;
+    if (this.token === this.tok.T_NAMESPACE) {
+      this.next().expect(this.tok.T_NS_SEPARATOR) && this.next();
+      relative = true;
+    }
+    return result(
+      this.read_list(this.tok.T_STRING, this.tok.T_NS_SEPARATOR, true),
+      relative
+    );
+  },
+  /**
+   * Reads a use statement
+   * ```ebnf
+   * use_statement ::= T_USE
+   *   use_type? use_declarations |
+   *   use_type use_statement '{' use_declarations '}' |
+   *   use_statement '{' use_declarations(=>typed) '}'
+   * ';'
+   * ```
+   * @see http://php.net/manual/en/language.namespaces.importing.php
+   * @return {UseGroup}
+   */
+  read_use_statement: function() {
+    let result = this.node("usegroup");
+    let items = [];
+    let name = null;
+    this.expect(this.tok.T_USE) && this.next();
+    const type = this.read_use_type();
+    items.push(this.read_use_declaration(false));
+    if (this.token === ",") {
+      items = items.concat(this.next().read_use_declarations(false));
+    } else if (this.token === "{") {
+      name = items[0].name;
+      items = this.next().read_use_declarations(type === null);
+      this.expect("}") && this.next();
+    }
+    result = result(name, type, items);
+    this.expect(";") && this.next();
+    return result;
+  },
+  /**
+   * Reads a use declaration
+   * ```ebnf
+   * use_declaration ::= use_type? namespace_name use_alias
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L380
+   * @return {UseItem}
+   */
+  read_use_declaration: function(typed) {
+    const result = this.node("useitem");
+    let type = null;
+    if (typed) type = this.read_use_type();
+    const name = this.read_namespace_name();
+    const alias = this.read_use_alias();
+    return result(name.name, alias, type);
+  },
+  /**
+   * Reads a list of use declarations
+   * ```ebnf
+   * use_declarations ::= use_declaration (',' use_declaration)*
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L380
+   * @return {UseItem[]}
+   */
+  read_use_declarations: function(typed) {
+    const result = [this.read_use_declaration(typed)];
+    while (this.token === ",") {
+      result.push(this.next().read_use_declaration(typed));
+    }
+    return result;
+  },
+  /**
+   * Reads a use statement
+   * ```ebnf
+   * use_alias ::= (T_AS T_STRING)?
+   * ```
+   * @return {String|null}
+   */
+  read_use_alias: function() {
+    let result = null;
+    if (this.token === this.tok.T_AS) {
+      if (this.next().expect(this.tok.T_STRING)) {
+        result = this.text();
+        this.next();
+      }
+    }
+    return result;
+  },
+  /**
+   * Reads the namespace type declaration
+   * ```ebnf
+   * use_type ::= (T_FUNCTION | T_CONST)?
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L335
+   * @return {String|null} Possible values : function, const
+   */
+  read_use_type: function() {
+    if (this.token === this.tok.T_FUNCTION) {
+      this.next();
+      return this.ast.useitem.TYPE_FUNCTION;
+    } else if (this.token === this.tok.T_CONST) {
+      this.next();
+      return this.ast.useitem.TYPE_CONST;
+    }
+    return null;
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_scalar.js.html b/parser_scalar.js.html new file mode 100644 index 000000000..9f3916b11 --- /dev/null +++ b/parser_scalar.js.html @@ -0,0 +1,446 @@ + + + + + + + + + + + parser/scalar.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/scalar.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+const specialChar = {
+  "\\r": "\r",
+  "\\n": "\n",
+  "\\t": "\t",
+  "\\v": String.fromCharCode(11),
+  "\\e": String.fromCharCode(27),
+  "\\f": String.fromCharCode(12),
+  "\\\\": "\\",
+  "\\$": "$",
+  '\\"': '"',
+  "\\'": "'"
+};
+
+module.exports = {
+  /**
+   * Unescape special chars
+   */
+  resolve_special_chars: function(text, doubleQuote) {
+    if (!doubleQuote) {
+      // single quote fix
+      return text.replace(/\\['\\]/g, function(seq) {
+        return specialChar[seq];
+      });
+    }
+    return text.replace(/\\[rntvef"'\\$]/g, function(seq) {
+      return specialChar[seq];
+    });
+  },
+  /**
+   * ```ebnf
+   *  scalar ::= T_MAGIC_CONST
+   *       | T_LNUMBER | T_DNUMBER
+   *       | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE? T_END_HEREDOC
+   *       | '"' encaps_list '"'
+   *       | T_START_HEREDOC encaps_list T_END_HEREDOC
+   *       | namespace_name (T_DOUBLE_COLON T_STRING)?
+   * ```
+   */
+  read_scalar: function() {
+    if (this.is("T_MAGIC_CONST")) {
+      return this.get_magic_constant();
+    } else {
+      let value, node;
+      switch (this.token) {
+        // TEXTS
+        case this.tok.T_CONSTANT_ENCAPSED_STRING: {
+          value = this.node("string");
+          const text = this.text();
+          let offset = 0;
+          if (text[0] === "b" || text[0] === "B") {
+            offset = 1;
+          }
+          const isDoubleQuote = text[offset] === '"';
+          this.next();
+          value = value(
+            isDoubleQuote,
+            this.resolve_special_chars(
+              text.substring(offset + 1, text.length - 1),
+              isDoubleQuote
+            ),
+            offset === 1, // unicode flag
+            text
+          );
+          if (this.token === this.tok.T_DOUBLE_COLON) {
+            // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1151
+            return this.read_static_getter(value);
+          } else {
+            // dirrect string
+            return value;
+          }
+        }
+        case this.tok.T_START_HEREDOC:
+          if (this.lexer.curCondition === "ST_NOWDOC") {
+            const start = this.lexer.yylloc.first_offset;
+            node = this.node("nowdoc");
+            value = this.next().text();
+            // strip the last line return char
+            const lastCh = value[value.length - 1];
+            if (lastCh === "\n") {
+              if (value[value.length - 2] === "\r") {
+                // windows style
+                value = value.substring(0, value.length - 2);
+              } else {
+                // linux style
+                value = value.substring(0, value.length - 1);
+              }
+            } else if (lastCh === "\r") {
+              // mac style
+              value = value.substring(0, value.length - 1);
+            }
+            this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE) && this.next();
+            const raw = this.lexer._input.substring(
+              start,
+              this.lexer.yylloc.last_offset
+            );
+            node = node(
+              value,
+              raw,
+              this.lexer.heredoc_label,
+              raw[3] === '"' || raw[3] === "'"
+            );
+            this.expect(this.tok.T_END_HEREDOC) && this.next();
+            return node;
+          } else {
+            return this.next().read_encapsed_string(this.tok.T_END_HEREDOC);
+          }
+
+        case '"':
+          return this.next().read_encapsed_string('"');
+
+        case 'b"':
+        case 'B"': {
+          this.next();
+          this.lexer.yylloc.prev_offset -= 1;
+          return this.read_encapsed_string('"');
+        }
+
+        // NUMERIC
+        case this.tok.T_LNUMBER: // long
+        case this.tok.T_DNUMBER: {
+          // double
+          const result = this.node("number");
+          value = this.text();
+          this.next();
+          return result(value, null);
+        }
+
+        // ARRAYS
+        case this.tok.T_ARRAY: // array parser
+          return this.read_array();
+        case "[": // short array format
+          return this.read_array();
+        default: {
+          const err = this.error("SCALAR");
+          // graceful mode : ignore token & return error node
+          this.next();
+          return err;
+        }
+      }
+    }
+  },
+  /**
+   * Handles the dereferencing
+   */
+  read_dereferencable: function(expr) {
+    let result, offset;
+    const node = this.node("offsetlookup");
+    if (this.token === "[") {
+      offset = this.next().read_expr();
+      if (this.expect("]")) this.next();
+      result = node(expr, offset);
+    } else if (this.token === this.tok.T_DOLLAR_OPEN_CURLY_BRACES) {
+      offset = this.read_encapsed_string_item(false);
+      result = node(expr, offset);
+    }
+    return result;
+  },
+  /**
+   * Reads and extracts an encapsed item
+   * ```ebnf
+   * encapsed_string_item ::= T_ENCAPSED_AND_WHITESPACE
+   *  | T_DOLLAR_OPEN_CURLY_BRACES expr '}'
+   *  | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}'
+   *  | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'
+   *  | T_CURLY_OPEN variable '}'
+   *  | variable
+   *  | variable '[' expr ']'
+   *  | variable T_OBJECT_OPERATOR T_STRING
+   * ```
+   * @return {String|Variable|Expr|Lookup}
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1219
+   */
+  read_encapsed_string_item: function(isDoubleQuote) {
+    let result = this.node(),
+      offset,
+      node,
+      name;
+
+    // plain text
+    // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1222
+    if (this.token === this.tok.T_ENCAPSED_AND_WHITESPACE) {
+      const text = this.text();
+      this.next();
+      result = result(
+        "string",
+        false,
+        this.resolve_special_chars(text, isDoubleQuote),
+        false,
+        text
+      );
+    } else if (this.token === this.tok.T_DOLLAR_OPEN_CURLY_BRACES) {
+      // dynamic variable name
+      // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1239
+      name = null;
+      if (this.next().token === this.tok.T_STRING_VARNAME) {
+        const varName = this.text();
+        name = this.node("variable");
+        this.next();
+        // check if lookup an offset
+        // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1243
+        if (this.token === "[") {
+          name = name(varName, false);
+          node = this.node("offsetlookup");
+          offset = this.next().read_expr();
+          this.expect("]") && this.next();
+          name = node(name, offset);
+        } else {
+          name = this.node("constref")(varName);
+        }
+      } else {
+        name = this.read_expr();
+      }
+      this.expect("}") && this.next();
+      result = result("variable", name, false, true);
+    } else if (this.token === this.tok.T_CURLY_OPEN) {
+      // expression
+      // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1246
+      result = this.next().read_variable(false, false, false);
+      if (result.kind === "variable") {
+        result.curly = true;
+      }
+      this.expect("}") && this.next();
+    } else if (this.token === this.tok.T_VARIABLE) {
+      // plain variable
+      // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1231
+      result = this.read_simple_variable(false);
+
+      // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1233
+      if (this.token === "[") {
+        node = this.node("offsetlookup");
+        offset = this.next().read_encaps_var_offset();
+        this.expect("]") && this.next();
+        result = node(result, offset);
+      }
+
+      // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1236
+      if (this.token === this.tok.T_OBJECT_OPERATOR) {
+        node = this.node("propertylookup");
+        const what = this.node("constref");
+        this.next().expect(this.tok.T_STRING);
+        name = this.text();
+        this.next();
+        result = node(result, what(name));
+      }
+
+      // error / fallback
+    } else {
+      this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);
+      const value = this.text();
+      this.next();
+      // consider it as string
+      result = result("string", false, value, false, value);
+    }
+
+    return result;
+  },
+  /**
+   * Reads an encapsed string
+   */
+  read_encapsed_string: function(expect) {
+    const start = this.lexer.yylloc.prev_offset;
+    let node = this.node("encapsed");
+    const value = [];
+    let type = null;
+
+    if (expect === "`") {
+      type = this.ast.encapsed.TYPE_SHELL;
+    } else if (expect === '"') {
+      type = this.ast.encapsed.TYPE_STRING;
+    } else {
+      type = this.ast.encapsed.TYPE_HEREDOC;
+    }
+
+    // reading encapsed parts
+    while (this.token !== expect && this.token !== this.EOF) {
+      value.push(this.read_encapsed_string_item(true));
+    }
+
+    this.expect(expect) && this.next();
+    node = node(
+      value,
+      this.lexer._input.substring(start - 1, this.lexer.yylloc.first_offset),
+      type
+    );
+
+    if (expect === this.tok.T_END_HEREDOC) {
+      node.label = this.lexer.heredoc_label;
+    }
+    return node;
+  },
+  /**
+   * Constant token
+   */
+  get_magic_constant: function() {
+    const result = this.node("magic");
+    const name = this.text();
+    this.next();
+    return result(name.toUpperCase(), name);
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_statement.js.html b/parser_statement.js.html new file mode 100644 index 000000000..a1d886f56 --- /dev/null +++ b/parser_statement.js.html @@ -0,0 +1,542 @@ + + + + + + + + + + + parser/statement.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/statement.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * reading a list of top statements (helper for top_statement*)
+   * ```ebnf
+   *  top_statements ::= top_statement*
+   * ```
+   */
+  read_top_statements: function() {
+    let result = [];
+    while (this.token !== this.EOF && this.token !== "}") {
+      const statement = this.read_top_statement();
+      if (statement) {
+        if (Array.isArray(statement)) {
+          result = result.concat(statement);
+        } else {
+          result.push(statement);
+        }
+      }
+    }
+    return result;
+  },
+  /**
+   * reading a top statement
+   * ```ebnf
+   *  top_statement ::=
+   *       namespace | function | class
+   *       | interface | trait
+   *       | use_statements | const_list
+   *       | statement
+   * ```
+   */
+  read_top_statement: function() {
+    switch (this.token) {
+      case this.tok.T_FUNCTION:
+        return this.read_function(false, false);
+      // optional flags
+      case this.tok.T_ABSTRACT:
+      case this.tok.T_FINAL: {
+        const flag = this.read_class_scope();
+        if (this.token === this.tok.T_CLASS) {
+          return this.read_class(flag);
+        } else {
+          this.error(this.tok.T_CLASS);
+          this.next();
+          return null;
+        }
+      }
+      case this.tok.T_CLASS:
+        return this.read_class([0, 0, 0]);
+      case this.tok.T_INTERFACE:
+        return this.read_interface();
+      case this.tok.T_TRAIT:
+        return this.read_trait();
+      case this.tok.T_USE:
+        return this.read_use_statement();
+      case this.tok.T_CONST:
+        return this.next().read_const_list();
+      case this.tok.T_NAMESPACE:
+        return this.read_namespace();
+      case this.tok.T_HALT_COMPILER: {
+        const result = this.node("halt");
+        if (this.next().expect("(")) this.next();
+        if (this.expect(")")) this.next();
+        this.expect(";");
+        this.lexer.done = true;
+        return result(this.lexer._input.substring(this.lexer.offset));
+      }
+      default:
+        return this.read_statement();
+    }
+  },
+  /**
+   * reads a list of simple inner statements (helper for inner_statement*)
+   * ```ebnf
+   *  inner_statements ::= inner_statement*
+   * ```
+   */
+  read_inner_statements: function() {
+    let result = [];
+    while (this.token != this.EOF && this.token !== "}") {
+      const statement = this.read_inner_statement();
+      if (statement) {
+        if (Array.isArray(statement)) {
+          result = result.concat(statement);
+        } else {
+          result.push(statement);
+        }
+      }
+    }
+    return result;
+  },
+  /**
+   * Reads a list of constants declaration
+   * ```ebnf
+   *   const_list ::= T_CONST T_STRING '=' expr (',' T_STRING '=' expr)* ';'
+   * ```
+   */
+  read_const_list: function() {
+    const result = this.read_list(
+      function() {
+        this.expect(this.tok.T_STRING);
+        const result = this.node("constant");
+        const name = this.text();
+        if (this.next().expect("=")) {
+          return result(name, this.next().read_expr());
+        } else {
+          // fallback
+          return result(name, null);
+        }
+      },
+      ",",
+      false
+    );
+    this.expectEndOfStatement();
+    return result;
+  },
+  /**
+   * Reads a list of constants declaration
+   * ```ebnf
+   *   declare_list ::= T_STRING '=' expr (',' T_STRING '=' expr)*
+   * ```
+   * @retrurn {Object}
+   */
+  read_declare_list: function() {
+    const result = {};
+    while (this.token != this.EOF && this.token !== ")") {
+      this.expect(this.tok.T_STRING);
+      const name = this.text().toLowerCase();
+      if (this.next().expect("=")) {
+        result[name] = this.next().read_expr();
+      } else {
+        result[name] = null;
+      }
+      if (this.token !== ",") break;
+      this.next();
+    }
+    return result;
+  },
+  /**
+   * reads a simple inner statement
+   * ```ebnf
+   *  inner_statement ::= '{' inner_statements '}' | token
+   * ```
+   */
+  read_inner_statement: function() {
+    switch (this.token) {
+      case this.tok.T_FUNCTION:
+        return this.read_function(false, false);
+      // optional flags
+      case this.tok.T_ABSTRACT:
+      case this.tok.T_FINAL: {
+        const flag = this.read_class_scope();
+        if (this.token === this.tok.T_CLASS) {
+          return this.read_class(flag);
+        } else {
+          this.error(this.tok.T_CLASS);
+          // graceful mode : ignore token & go next
+          this.next();
+          return null;
+        }
+      }
+      case this.tok.T_CLASS:
+        return this.read_class([0, 0, 0]);
+      case this.tok.T_INTERFACE:
+        return this.read_interface();
+      case this.tok.T_TRAIT:
+        return this.read_trait();
+      case this.tok.T_HALT_COMPILER: {
+        this.raiseError(
+          "__HALT_COMPILER() can only be used from the outermost scope"
+        );
+        // fallback : returns a node but does not stop the parsing
+        let node = this.node("halt");
+        this.next().expect("(") && this.next();
+        this.expect(")") && this.next();
+        node = node(this.lexer._input.substring(this.lexer.offset));
+        this.expect(";") && this.next();
+        return node;
+      }
+      default:
+        return this.read_statement();
+    }
+  },
+  /**
+   * Reads statements
+   */
+  read_statement: function() {
+    let result, expr, items, current, label;
+    switch (this.token) {
+      case "{":
+        return this.read_code_block(false);
+
+      case this.tok.T_IF:
+        return this.read_if();
+
+      case this.tok.T_SWITCH:
+        return this.read_switch();
+
+      case this.tok.T_FOR:
+        return this.next().read_for();
+
+      case this.tok.T_FOREACH:
+        return this.next().read_foreach();
+
+      case this.tok.T_WHILE:
+        return this.next().read_while();
+
+      case this.tok.T_DO:
+        return this.next().read_do();
+
+      case this.tok.T_COMMENT:
+        return this.read_comment();
+
+      case this.tok.T_DOC_COMMENT:
+        return this.read_doc_comment();
+
+      case this.tok.T_RETURN:
+        result = this.node("return");
+        expr = null;
+        if (!this.next().is("EOS")) {
+          expr = this.read_expr();
+        }
+        this.expectEndOfStatement();
+        return result(expr);
+
+      // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L429
+      case this.tok.T_BREAK:
+      case this.tok.T_CONTINUE: {
+        result = this.node(
+          this.token === this.tok.T_CONTINUE ? "continue" : "break"
+        );
+        let level = null;
+        this.next(); // look ahead
+        if (this.token !== ";") {
+          level = this.read_expr();
+        }
+        this.expectEndOfStatement();
+        return result(level);
+      }
+
+      case this.tok.T_GLOBAL:
+        result = this.node("global");
+        items = this.next().read_list(this.read_simple_variable, ",");
+        this.expectEndOfStatement();
+        return result(items);
+
+      case this.tok.T_STATIC:
+        current = [this.token, this.lexer.getState()];
+        result = this.node("static");
+        if (this.next().token === this.tok.T_DOUBLE_COLON) {
+          // static keyword for a class
+          this.lexer.tokens.push(current);
+          expr = this.next().read_expr();
+          this.expect(";") && this.next();
+          return expr;
+        }
+        if (this.token === this.tok.T_FUNCTION) {
+          return this.read_function(true, [0, 1, 0]);
+        }
+        items = this.read_variable_declarations();
+        this.expectEndOfStatement();
+        return result(items);
+
+      case this.tok.T_ECHO: {
+        result = this.node("echo");
+        const text = this.text();
+        const shortForm = text === "<?=" || text === "<%=";
+        const args = this.next().read_list(this.read_expr, ",");
+        this.expectEndOfStatement();
+        return result(args, shortForm);
+      }
+
+      case this.tok.T_INLINE_HTML: {
+        const value = this.text();
+        let prevChar =
+          this.lexer.yylloc.first_offset > 0
+            ? this.lexer._input[this.lexer.yylloc.first_offset - 1]
+            : null;
+        const fixFirstLine = prevChar === "\r" || prevChar === "\n";
+        // revert back the first stripped line
+        if (fixFirstLine) {
+          if (
+            prevChar === "\n" &&
+            this.lexer.yylloc.first_offset > 1 &&
+            this.lexer._input[this.lexer.yylloc.first_offset - 2] === "\r"
+          ) {
+            prevChar = "\r\n";
+          }
+        }
+        result = this.node("inline");
+        this.next();
+        return result(value, fixFirstLine ? prevChar + value : value);
+      }
+
+      case this.tok.T_UNSET:
+        result = this.node("unset");
+        this.next().expect("(") && this.next();
+        items = this.read_list(this.read_variable, ",");
+        this.expect(")") && this.next();
+        this.expect(";") && this.next();
+        return result(items);
+
+      case this.tok.T_DECLARE: {
+        result = this.node("declare");
+        const body = [];
+        let mode;
+        this.next().expect("(") && this.next();
+        const what = this.read_declare_list();
+        this.expect(")") && this.next();
+        if (this.token === ":") {
+          this.next();
+          while (
+            this.token != this.EOF &&
+            this.token !== this.tok.T_ENDDECLARE
+          ) {
+            // @todo : check declare_statement from php / not valid
+            body.push(this.read_top_statement());
+          }
+          this.expect(this.tok.T_ENDDECLARE) && this.next();
+          this.expectEndOfStatement();
+          mode = this.ast.declare.MODE_SHORT;
+        } else if (this.token === "{") {
+          this.next();
+          while (this.token != this.EOF && this.token !== "}") {
+            // @todo : check declare_statement from php / not valid
+            body.push(this.read_top_statement());
+          }
+          this.expect("}") && this.next();
+          mode = this.ast.declare.MODE_BLOCK;
+        } else {
+          this.expect(";") && this.next();
+          mode = this.ast.declare.MODE_NONE;
+        }
+        return result(what, body, mode);
+      }
+
+      case this.tok.T_TRY:
+        return this.read_try();
+
+      case this.tok.T_THROW:
+        result = this.node("throw");
+        expr = this.next().read_expr();
+        this.expectEndOfStatement();
+        return result(expr);
+
+      case ";": // ignore this (extra ponctuation)
+        this.next();
+        return null;
+
+      case this.tok.T_STRING:
+        current = [this.token, this.lexer.getState()];
+        label = this.text();
+        // AST : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L457
+        if (this.next().token === ":") {
+          result = this.node("label");
+          this.next();
+          return result(label);
+        }
+
+        // default fallback expr / T_STRING '::' (etc...)
+        this.lexer.tokens.push(current);
+        expr = this.next().read_expr();
+        this.expectEndOfStatement();
+        return expr;
+
+      case this.tok.T_GOTO:
+        result = this.node("goto");
+        label = null;
+        if (this.next().expect(this.tok.T_STRING)) {
+          label = this.text();
+          this.next().expectEndOfStatement();
+        }
+        return result(label);
+
+      default:
+        // default fallback expr
+        expr = this.read_expr();
+        this.expectEndOfStatement(expr);
+        return expr;
+    }
+  },
+  /**
+   * ```ebnf
+   *  code_block ::= '{' (inner_statements | top_statements) '}'
+   * ```
+   */
+  read_code_block: function(top) {
+    const result = this.node("block");
+    this.expect("{") && this.next();
+    const body = top
+      ? this.read_top_statements()
+      : this.read_inner_statements();
+    this.expect("}") && this.next();
+    return result(null, body);
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_switch.js.html b/parser_switch.js.html new file mode 100644 index 000000000..e540893ed --- /dev/null +++ b/parser_switch.js.html @@ -0,0 +1,230 @@ + + + + + + + + + + + parser/switch.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/switch.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * Reads a switch statement
+   * ```ebnf
+   *  switch ::= T_SWITCH '(' expr ')' switch_case_list
+   * ```
+   * @return {Switch}
+   * @see http://php.net/manual/en/control-structures.switch.php
+   */
+  read_switch: function() {
+    this.expect(this.tok.T_SWITCH) && this.next();
+    const result = this.node("switch");
+    this.expect("(") && this.next();
+    const test = this.read_expr();
+    this.expect(")") && this.next();
+    const shortForm = this.token === ":";
+    const body = this.read_switch_case_list();
+    return result(test, body, shortForm);
+  },
+  /**
+   * ```ebnf
+   *  switch_case_list ::= '{' ';'? case_list* '}' | ':' ';'? case_list* T_ENDSWITCH ';'
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L566
+   */
+  read_switch_case_list: function() {
+    // DETECT SWITCH MODE
+    let expect = null;
+    const result = this.node("block");
+    const items = [];
+    if (this.token === "{") {
+      expect = "}";
+    } else if (this.token === ":") {
+      expect = this.tok.T_ENDSWITCH;
+    } else {
+      this.expect(["{", ":"]);
+    }
+    // OPTIONNAL ';'
+    // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L570
+    if (this.next().token === ";") {
+      this.next();
+    }
+    // EXTRACTING CASES
+    while (this.token !== this.EOF && this.token !== expect) {
+      items.push(this.read_case_list(expect));
+    }
+    // CHECK END TOKEN
+    this.expect(expect) && this.next();
+    if (expect === this.tok.T_ENDSWITCH) {
+      this.expectEndOfStatement();
+    }
+    return result(null, items);
+  },
+  /**
+   * ```ebnf
+   *   case_list ::= ((T_CASE expr) | T_DEFAULT) (':' | ';') inner_statement*
+   * ```
+   */
+  read_case_list: function(stopToken) {
+    const result = this.node("case");
+    let test = null;
+    let body = null;
+    const items = [];
+    if (this.token === this.tok.T_CASE) {
+      test = this.next().read_expr();
+    } else if (this.token === this.tok.T_DEFAULT) {
+      // the defaut entry - no condition
+      this.next();
+    } else {
+      this.expect([this.tok.T_CASE, this.tok.T_DEFAULT]);
+    }
+    this.expect([":", ";"]) && this.next();
+    body = this.node("block");
+    while (
+      this.token != this.EOF &&
+      this.token !== stopToken &&
+      this.token !== this.tok.T_CASE &&
+      this.token !== this.tok.T_DEFAULT
+    ) {
+      items.push(this.read_inner_statement());
+    }
+    return result(test, items.length > 0 ? body(null, items) : null);
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_try.js.html b/parser_try.js.html new file mode 100644 index 000000000..468a00abd --- /dev/null +++ b/parser_try.js.html @@ -0,0 +1,179 @@ + + + + + + + + + + + parser/try.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/try.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * ```ebnf
+   *  try ::= T_TRY '{' inner_statement* '}'
+   *          (
+   *              T_CATCH '(' namespace_name variable ')' '{'  inner_statement* '}'
+   *          )*
+   *          (T_FINALLY '{' inner_statement* '}')?
+   * ```
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L448
+   * @return {Try}
+   */
+  read_try: function() {
+    this.expect(this.tok.T_TRY);
+    const result = this.node("try");
+    let always = null;
+    const catches = [];
+    const body = this.next().read_statement();
+    // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L455
+    while (this.token === this.tok.T_CATCH) {
+      const item = this.node("catch");
+      this.next().expect("(") && this.next();
+      const what = this.read_list(this.read_namespace_name, "|", false);
+      const variable = this.read_variable(true, false, false);
+      this.expect(")");
+      catches.push(item(this.next().read_statement(), what, variable));
+    }
+    if (this.token === this.tok.T_FINALLY) {
+      always = this.next().read_statement();
+    }
+    return result(body, catches, always);
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_utils.js.html b/parser_utils.js.html new file mode 100644 index 000000000..021fe7526 --- /dev/null +++ b/parser_utils.js.html @@ -0,0 +1,255 @@ + + + + + + + + + + + parser/utils.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/utils.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * Reads a short form of tokens
+   * @param {Number} token - The ending token
+   * @return {Block}
+   */
+  read_short_form: function(token) {
+    const body = this.node("block");
+    const items = [];
+    if (this.expect(":")) this.next();
+    while (this.token != this.EOF && this.token !== token) {
+      items.push(this.read_inner_statement());
+    }
+    if (this.expect(token)) this.next();
+    this.expectEndOfStatement();
+    return body(null, items);
+  },
+
+  /**
+   * Helper : reads a list of tokens / sample : T_STRING ',' T_STRING ...
+   * ```ebnf
+   * list ::= separator? ( item separator )* item
+   * ```
+   */
+  read_list: function(item, separator, preserveFirstSeparator) {
+    const result = [];
+
+    if (this.token == separator) {
+      if (preserveFirstSeparator) result.push(null);
+      this.next();
+    }
+
+    if (typeof item === "function") {
+      do {
+        result.push(item.apply(this, []));
+        if (this.token != separator) {
+          break;
+        }
+      } while (this.next().token != this.EOF);
+    } else {
+      if (this.expect(item)) {
+        result.push(this.text());
+      } else {
+        return [];
+      }
+      while (this.next().token != this.EOF) {
+        if (this.token != separator) break;
+        // trim current separator & check item
+        if (this.next().token != item) break;
+        result.push(this.text());
+      }
+    }
+    return result;
+  },
+
+  /**
+   * Reads a list of names separated by a comma
+   *
+   * ```ebnf
+   * name_list ::= namespace (',' namespace)*
+   * ```
+   *
+   * Sample code :
+   * ```php
+   * <?php class foo extends bar, baz { }
+   * ```
+   *
+   * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L726
+   * @return {Identifier[]}
+   */
+  read_name_list: function() {
+    return this.read_list(this.read_namespace_name, ",", false);
+  },
+
+  /**
+   * Reads a list of variables declarations
+   *
+   * ```ebnf
+   * variable_declaration ::= T_VARIABLE ('=' expr)?*
+   * variable_declarations ::= variable_declaration (',' variable_declaration)*
+   * ```
+   *
+   * Sample code :
+   * ```php
+   * <?php class foo extends bar, baz { }
+   * ```
+   * @return {Variable[]|Assign[]} Returns an array composed by a list of variables, or
+   * assign values
+   */
+  read_variable_declarations: function() {
+    return this.read_list(function() {
+      const node = this.node("assign");
+      let variable = this.node("variable");
+      // plain variable name
+      if (this.expect(this.tok.T_VARIABLE)) {
+        const name = this.text().substring(1);
+        this.next();
+        variable = variable(name, false, false);
+      } else {
+        variable = variable("#ERR", false, false);
+      }
+      if (this.token === "=") {
+        return node(variable, this.next().read_expr());
+      } else {
+        return variable;
+      }
+    }, ",");
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/parser_variable.js.html b/parser_variable.js.html new file mode 100644 index 000000000..689fd18e5 --- /dev/null +++ b/parser_variable.js.html @@ -0,0 +1,480 @@ + + + + + + + + + + + parser/variable.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ parser/variable.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+module.exports = {
+  /**
+   * Reads a variable
+   *
+   * ```ebnf
+   *   variable ::= &? ...complex @todo
+   * ```
+   *
+   * Some samples of parsed code :
+   * ```php
+   *  &$var                      // simple var
+   *  $var                      // simple var
+   *  classname::CONST_NAME     // dynamic class name with const retrieval
+   *  foo()                     // function call
+   *  $var->func()->property    // chained calls
+   * ```
+   */
+  read_variable: function(read_only, encapsed, byref) {
+    let result;
+
+    // check the byref flag
+    if (!byref && this.token === "&") {
+      byref = true;
+      this.next();
+    }
+
+    // reads the entry point
+    if (this.is([this.tok.T_VARIABLE, "$"])) {
+      result = this.read_reference_variable(encapsed, byref);
+    } else if (
+      this.is([
+        this.tok.T_NS_SEPARATOR,
+        this.tok.T_STRING,
+        this.tok.T_NAMESPACE
+      ])
+    ) {
+      result = this.node();
+      const name = this.read_namespace_name();
+      if (this.token != this.tok.T_DOUBLE_COLON && this.token != "(") {
+        // @see parser.js line 130 : resolves a conflict with scalar
+        const literal = name.name.toLowerCase();
+        if (literal === "true") {
+          result = result("boolean", true, name.name);
+        } else if (literal === "false") {
+          result = result("boolean", false, name.name);
+        } else {
+          // @todo null keyword ?
+          result = result("constref", name);
+        }
+      } else {
+        result = name;
+      }
+    } else if (this.token === this.tok.T_STATIC) {
+      result = this.node("constref");
+      this.next();
+      result = result("static");
+    } else {
+      this.expect("VARIABLE");
+    }
+
+    // static mode
+    if (this.token === this.tok.T_DOUBLE_COLON) {
+      result = this.read_static_getter(result, encapsed);
+    }
+
+    return this.recursive_variable_chain_scan(result, read_only, encapsed);
+  },
+
+  // resolves a static call
+  read_static_getter: function(what, encapsed) {
+    const result = this.node("staticlookup");
+    let offset, name;
+    if (this.next().is([this.tok.T_VARIABLE, "$"])) {
+      offset = this.read_reference_variable(encapsed, false);
+    } else if (
+      this.token === this.tok.T_STRING ||
+      this.token === this.tok.T_CLASS ||
+      (this.php7 && this.is("IDENTIFIER"))
+    ) {
+      offset = this.node("constref");
+      name = this.text();
+      this.next();
+      offset = offset(name);
+    } else {
+      this.error([this.tok.T_VARIABLE, this.tok.T_STRING]);
+      // graceful mode : set getter as error node and continue
+      offset = this.node("constref");
+      name = this.text();
+      this.next();
+      offset = offset(name);
+    }
+    return result(what, offset);
+  },
+
+  recursive_variable_chain_scan: function(result, read_only, encapsed) {
+    let name, node, offset;
+    recursive_scan_loop: while (this.token != this.EOF) {
+      switch (this.token) {
+        case "(":
+          if (read_only) {
+            // @fixme : add more informations & test
+            return result;
+          } else {
+            result = this.node("call")(
+              result,
+              this.read_function_argument_list()
+            );
+          }
+          break;
+        case "[":
+          node = this.node("offsetlookup");
+          this.next();
+          offset = false;
+          if (encapsed) {
+            offset = this.read_encaps_var_offset();
+            this.expect("]") && this.next();
+          } else {
+            // callable_variable : https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L1122
+            if (this.token !== "]") {
+              offset = this.read_expr();
+              this.expect("]") && this.next();
+            } else {
+              this.next();
+            }
+          }
+          result = node(result, offset);
+          break;
+        case this.tok.T_DOUBLE_COLON:
+          // @see https://github.com/glayzzle/php-parser/issues/107#issuecomment-354104574
+          if (result.kind === "staticlookup") {
+            this.error();
+          }
+
+          node = this.node("staticlookup");
+          if (
+            this.next().token === this.tok.T_STRING ||
+            (this.php7 && this.is("IDENTIFIER"))
+          ) {
+            offset = this.node("constref");
+            name = this.text();
+            this.next();
+            offset = offset(name);
+
+            if (this.token === this.tok.T_OBJECT_OPERATOR) {
+              this.error();
+            }
+          } else {
+            this.error(this.tok.T_STRING);
+            // fallback on a constref node
+            offset = this.node("constref")(this.text());
+            this.next();
+          }
+          result = node(result, offset);
+          break;
+        case this.tok.T_OBJECT_OPERATOR: {
+          node = this.node("propertylookup");
+          let what = null;
+          switch (this.next().token) {
+            case this.tok.T_STRING:
+              what = this.node("constref");
+              name = this.text();
+              this.next();
+              what = what(name);
+              if (this.token === this.tok.T_VARIABLE) {
+                const inner = this.node("variable");
+                name = this.text().substring(1);
+                this.next();
+                what = this.node("encapsed")(
+                  [what, inner(name, false, false)],
+                  null,
+                  "offset"
+                );
+                if (what.loc && what.value[0].loc) {
+                  what.loc.start = what.value[0].loc.start;
+                }
+              } else if (this.token === "{") {
+                const expr = this.next().read_expr();
+                this.expect("}") && this.next();
+                what = this.node("encapsed")([what, expr], null, "offset");
+                if (what.loc && what.value[0].loc) {
+                  what.loc.start = what.value[0].loc.start;
+                }
+              }
+              break;
+            case this.tok.T_VARIABLE:
+              what = this.node("variable");
+              name = this.text().substring(1);
+              this.next();
+              what = what(name, false, false);
+              break;
+            case "$":
+              this.next().expect(["{", this.tok.T_VARIABLE]);
+              if (this.token === "{") {
+                // $obj->${$varname}
+                what = this.next().read_expr();
+                this.expect("}") && this.next();
+              } else {
+                // $obj->$$varname
+                what = this.read_expr();
+              }
+              break;
+            case "{":
+              what = this.next().read_expr();
+              this.expect("}") && this.next();
+              break;
+            default:
+              this.error([this.tok.T_STRING, this.tok.T_VARIABLE]);
+              // graceful mode : set what as error mode & continue
+              what = this.node("constref");
+              name = this.text();
+              this.next();
+              what = what(name);
+              break;
+          }
+          result = node(result, what);
+          break;
+        }
+        default:
+          break recursive_scan_loop;
+      }
+    }
+    return result;
+  },
+  /**
+   * https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L1231
+   */
+  read_encaps_var_offset: function() {
+    let offset = this.node();
+    if (this.token === this.tok.T_STRING) {
+      const text = this.text();
+      this.next();
+      offset = offset("constref", text);
+    } else if (this.token === this.tok.T_NUM_STRING) {
+      const num = this.text();
+      this.next();
+      offset = offset("number", num, null);
+    } else if (this.token === this.tok.T_VARIABLE) {
+      const name = this.text().substring(1);
+      this.next();
+      offset = offset("variable", name, false, false);
+    } else {
+      this.expect([
+        this.tok.T_STRING,
+        this.tok.T_NUM_STRING,
+        this.tok.T_VARIABLE
+      ]);
+      // fallback : consider as constref
+      const text = this.text();
+      this.next();
+      offset = offset("constref", text);
+    }
+    return offset;
+  },
+  /**
+   * ```ebnf
+   *  reference_variable ::=  simple_variable ('[' OFFSET ']')* | '{' EXPR '}'
+   * ```
+   * <code>
+   *  $foo[123];      // foo is an array ==> gets its entry
+   *  $foo{1};        // foo is a string ==> get the 2nd char offset
+   *  ${'foo'}[123];  // get the dynamic var $foo
+   *  $foo[123]{1};   // gets the 2nd char from the 123 array entry
+   * </code>
+   */
+  read_reference_variable: function(encapsed, byref) {
+    let result = this.read_simple_variable(byref);
+    let offset;
+    while (this.token != this.EOF) {
+      const node = this.node();
+      if (this.token == "[") {
+        offset = null;
+        if (encapsed) {
+          offset = this.next().read_encaps_var_offset();
+        } else {
+          offset = this.next().token === "]" ? null : this.read_dim_offset();
+        }
+        this.expect("]") && this.next();
+        result = node("offsetlookup", result, offset);
+      } else if (this.token == "{" && !encapsed) {
+        offset = this.next().read_expr();
+        this.expect("}") && this.next();
+        result = node("offsetlookup", result, offset);
+      } else break;
+    }
+    return result;
+  },
+  /**
+   * ```ebnf
+   *  simple_variable ::= T_VARIABLE | '$' '{' expr '}' | '$' simple_variable
+   * ```
+   */
+  read_simple_variable: function(byref) {
+    let result = this.node("variable");
+    let name;
+    if (
+      this.expect([this.tok.T_VARIABLE, "$"]) &&
+      this.token === this.tok.T_VARIABLE
+    ) {
+      // plain variable name
+      name = this.text().substring(1);
+      this.next();
+      result = result(name, byref, false);
+    } else {
+      if (this.token === "$") this.next();
+      // dynamic variable name
+      switch (this.token) {
+        case "{": {
+          const expr = this.next().read_expr();
+          this.expect("}") && this.next();
+          result = result(expr, byref, true);
+          break;
+        }
+        case "$": // $$$var
+          result = result(this.read_simple_variable(false), byref);
+          break;
+        case this.tok.T_VARIABLE: {
+          // $$var
+          name = this.text().substring(1);
+          const node = this.node("variable");
+          this.next();
+          result = result(node(name, false, false), byref, false);
+          break;
+        }
+        default:
+          this.error(["{", "$", this.tok.T_VARIABLE]);
+          // graceful mode
+          name = this.text();
+          this.next();
+          result = result(name, byref, false);
+      }
+    }
+    return result;
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/scripts/linenumber.js b/scripts/linenumber.js new file mode 100644 index 000000000..ff6c0693b --- /dev/null +++ b/scripts/linenumber.js @@ -0,0 +1,24 @@ +'use strict'; + +/* global document */ +(function () { + var lineId, lines, totalLines, anchorHash; + var source = document.getElementsByClassName('prettyprint source linenums'); + var i = 0; + var lineNumber = 0; + + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; + + for (; i < totalLines; i++) { + lineNumber++; + lineId = 'line' + lineNumber; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } + } +})(); diff --git a/scripts/pagelocation.js b/scripts/pagelocation.js new file mode 100644 index 000000000..e1383680c --- /dev/null +++ b/scripts/pagelocation.js @@ -0,0 +1,89 @@ +'use strict'; + +$(document).ready(function () { + var currentSectionNav, target; + + // If an anchor hash is in the URL highlight the menu item + highlightActiveHash(); + // If a specific page section is in the URL highlight the menu item + highlightActiveSection(); + + // If a specific page section is in the URL scroll that section up to the top + currentSectionNav = $('#' + getCurrentSectionName() + '-nav'); + + if (currentSectionNav.position()) { + $('nav').scrollTop(currentSectionNav.position().top); + } + + // function to scroll to anchor when clicking an anchor linl + $('a[href*="#"]:not([href="#"])').click(function () { + /* eslint-disable no-invalid-this */ + if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) { + target = $(this.hash); + target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); + if (target.length) { + $('html, body').animate({ + scrollTop: target.offset().top + }, 1000); + } + } + /* eslint-enable no-invalid-this */ + }); +}); + +// If a new anchor section is selected, change the hightlighted menu item +$(window).bind('hashchange', function (event) { + highlightActiveHash(event); +}); + +function highlightActiveHash(event) { + var oldUrl, oldSubSectionElement; + + // check for and remove old hash active state + if (event && event.originalEvent.oldURL) { + oldUrl = event.originalEvent.oldURL; + + if (oldUrl.indexOf('#') > -1) { + oldSubSectionElement = $('#' + getCurrentSectionName() + '-' + oldUrl.substring(oldUrl.indexOf('#') + 1) + '-nav'); + + if (oldSubSectionElement) { + oldSubSectionElement.removeClass('active'); + } + } + } + + if (getCurrentHashName()) { + $('#' + getCurrentSectionName() + '-' + getCurrentHashName() + '-nav').addClass('active'); + } +} + +function highlightActiveSection() { + var pageId = getCurrentSectionName(); + + $('#' + pageId + '-nav').addClass('active'); +} + +function getCurrentSectionName() { + var path = window.location.pathname; + var pageUrl = path.split('/').pop(); + + var sectionName = pageUrl.substring(0, pageUrl.indexOf('.')); + + // remove the wodr module- if its in the url + sectionName = sectionName.replace('module-', ''); + + return sectionName; +} + +function getCurrentHashName() { + var pageSubSectionId; + var pageSubSectionHash = window.location.hash; + + if (pageSubSectionHash) { + pageSubSectionId = pageSubSectionHash.substring(1).replace('.', ''); + + return pageSubSectionId; + } + + return false; +} diff --git a/src/ast.js b/src/ast.js deleted file mode 100644 index d912b3a46..000000000 --- a/src/ast.js +++ /dev/null @@ -1,392 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Location = require("./ast/location"); -const Position = require("./ast/position"); - -/** - * ## Class hierarchy - * - * - [Location](#location) - * - [Position](#position) - * - [Node](#node) - * - [Identifier](#identifier) - * - [TraitUse](#traituse) - * - [TraitAlias](#traitalias) - * - [TraitPrecedence](#traitprecedence) - * - [Entry](#entry) - * - [Case](#case) - * - [Label](#label) - * - [Comment](#comment) - * - [CommentLine](#commentline) - * - [CommentBlock](#commentblock) - * - [Error](#error) - * - [Expression](#expression) - * - [Array](#array) - * - [Variable](#variable) - * - [Variadic](#variadic) - * - [ConstRef](#constref) - * - [Yield](#yield) - * - [YieldFrom](#yieldfrom) - * - [Lookup](#lookup) - * - [PropertyLookup](#propertylookup) - * - [StaticLookup](#staticlookup) - * - [OffsetLookup](#offsetlookup) - * - [Operation](#operation) - * - [Pre](#pre) - * - [Post](#post) - * - [Bin](#bin) - * - [Unary](#unary) - * - [Cast](#cast) - * - [Literal](#literal) - * - [Boolean](#boolean) - * - [String](#string) - * - [Number](#number) - * - [Inline](#inline) - * - [Magic](#magic) - * - [Nowdoc](#nowdoc) - * - [Encapsed](#encapsed) - * - [Statement](#statement) - * - [Eval](#eval) - * - [Exit](#exit) - * - [Halt](#halt) - * - [Clone](#clone) - * - [Declare](#declare) - * - [Global](#global) - * - [Static](#static) - * - [Include](#include) - * - [Assign](#assign) - * - [RetIf](#retif) - * - [If](#if) - * - [Do](#do) - * - [While](#while) - * - [For](#for) - * - [Foreach](#foreach) - * - [Switch](#switch) - * - [Goto](#goto) - * - [Silent](#silent) - * - [Try](#try) - * - [Catch](#catch) - * - [Throw](#throw) - * - [Call](#call) - * - [Closure](#closure) - * - [New](#new) - * - [UseGroup](#usegroup) - * - [UseItem](#useitem) - * - [Block](#block) - * - [Program](#program) - * - [Namespace](#namespace) - * - [Sys](#sys) - * - [Echo](#echo) - * - [List](#list) - * - [Print](#print) - * - [Isset](#isset) - * - [Unset](#unset) - * - [Empty](#empty) - * - [Declaration](#declaration) - * - [Class](#class) - * - [Interface](#interface) - * - [Trait](#trait) - * - [Constant](#constant) - * - [ClassConstant](#classconstant) - * - [Function](#function) - * - [Method](#method) - * - [Parameter](#parameter) - * - [Property](#property) - * --- - */ - -/** - * The AST builder class - * @constructor AST - * @tutorial AST - * @property {Boolean} withPositions - Should locate any node (by default false) - * @property {Boolean} withSource - Should extract the node original code (by default false) - */ -const AST = function(withPositions, withSource) { - this.withPositions = withPositions; - this.withSource = withSource; -}; - -/** - * Create a position node from specified parser - * including it's lexer current state - * @param {Parser} - * @return {Position} - * @private - */ -AST.prototype.position = function(parser) { - return new Position( - parser.lexer.yylloc.first_line, - parser.lexer.yylloc.first_column, - parser.lexer.yylloc.first_offset - ); -}; - -// operators in ascending order of precedence -AST.precedence = {}; -[ - ["or"], - ["xor"], - ["and"], - ["="], - ["?"], - ["??"], - ["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "!=", "===", "!==", /* '<>', */ "<=>"], - ["<", "<=", ">", ">="], - ["<<", ">>"], - ["+", "-", "."], - ["*", "/", "%"], - ["!"], - ["instanceof"] - // TODO: typecasts - // TODO: [ (array) - // TODO: clone, new -].forEach(function(list, index) { - list.forEach(function(operator) { - AST.precedence[operator] = index + 1; - }); -}); - -/** - * Check and fix precence, by default using right - */ -AST.prototype.resolvePrecedence = function(result) { - let buffer, lLevel, rLevel; - // handling precendence - if (result.kind === "bin") { - if (result.right && !result.right.parenthesizedExpression) { - if (result.right.kind === "bin") { - lLevel = AST.precedence[result.type]; - rLevel = AST.precedence[result.right.type]; - if (lLevel && rLevel && rLevel <= lLevel) { - // https://github.com/glayzzle/php-parser/issues/79 - // shift precedence - buffer = result.right; - result.right = result.right.left; - buffer.left = this.resolvePrecedence(result); - result = buffer; - } - } else if (result.right.kind === "retif") { - lLevel = AST.precedence[result.type]; - rLevel = AST.precedence["?"]; - if (lLevel && rLevel && rLevel <= lLevel) { - buffer = result.right; - result.right = result.right.test; - buffer.test = this.resolvePrecedence(result); - result = buffer; - } - } - } - } else if (result.kind === "unary") { - // https://github.com/glayzzle/php-parser/issues/75 - if (result.what && !result.what.parenthesizedExpression) { - // unary precedence is allways lower - if (result.what.kind === "bin") { - buffer = result.what; - result.what = result.what.left; - buffer.left = this.resolvePrecedence(result); - result = buffer; - } else if (result.what.kind === "retif") { - buffer = result.what; - result.what = result.what.test; - buffer.test = this.resolvePrecedence(result); - result = buffer; - } - } - } else if (result.kind === "retif") { - // https://github.com/glayzzle/php-parser/issues/77 - if ( - result.falseExpr && - result.falseExpr.kind === "retif" && - !result.falseExpr.parenthesizedExpression - ) { - buffer = result.falseExpr; - result.falseExpr = buffer.test; - buffer.test = this.resolvePrecedence(result); - result = buffer; - } - } else if (result.kind === "assign") { - // https://github.com/glayzzle/php-parser/issues/81 - if ( - result.right && - result.right.kind === "bin" && - !result.right.parenthesizedExpression - ) { - lLevel = AST.precedence["="]; - rLevel = AST.precedence[result.right.type]; - // only shifts with and, xor, or - if (lLevel && rLevel && rLevel < lLevel) { - buffer = result.right; - result.right = result.right.left; - buffer.left = result; - result = buffer; - } - } - } - return result; -}; - -/** - * Prepares an AST node - * @param {String|null} kind - Defines the node type - * (if null, the kind must be passed at the function call) - * @param {Parser} parser - The parser instance (use for extracting locations) - * @return {Function} - */ -AST.prototype.prepare = function(kind, docs, parser) { - let start = null; - if (this.withPositions || this.withSource) { - start = this.position(parser); - } - const self = this; - // returns the node - const result = function() { - let location = null; - const args = Array.prototype.slice.call(arguments); - args.push(docs); - if (self.withPositions || self.withSource) { - let src = null; - if (self.withSource) { - src = parser.lexer._input.substring(start.offset, parser.prev[2]); - } - if (self.withPositions) { - location = new Location( - src, - start, - new Position(parser.prev[0], parser.prev[1], parser.prev[2]) - ); - } else { - location = new Location(src, null, null); - } - // last argument is allways the location - args.push(location); - } - // handle lazy kind definitions - if (!kind) { - kind = args.shift(); - } - // build the object - const node = self[kind]; - if (typeof node !== "function") { - throw new Error('Undefined node "' + kind + '"'); - } - const result = Object.create(node.prototype); - node.apply(result, args); - return self.resolvePrecedence(result); - }; - /** - * Helper to change a node kind - * @param {String} newKind - */ - result.setKind = function(newKind) { - kind = newKind; - }; - return result; -}; - -// Define all AST nodes -[ - require("./ast/array"), - require("./ast/assign"), - require("./ast/bin"), - require("./ast/block"), - require("./ast/boolean"), - require("./ast/break"), - require("./ast/call"), - require("./ast/case"), - require("./ast/cast"), - require("./ast/catch"), - require("./ast/class"), - require("./ast/classconstant"), - require("./ast/clone"), - require("./ast/closure"), - require("./ast/comment"), - require("./ast/commentblock"), - require("./ast/commentline"), - require("./ast/constant"), - require("./ast/constref"), - require("./ast/continue"), - require("./ast/declaration"), - require("./ast/declare"), - require("./ast/do"), - require("./ast/echo"), - require("./ast/empty"), - require("./ast/encapsed"), - require("./ast/entry"), - require("./ast/error"), - require("./ast/eval"), - require("./ast/exit"), - require("./ast/expression"), - require("./ast/for"), - require("./ast/foreach"), - require("./ast/function"), - require("./ast/global"), - require("./ast/goto"), - require("./ast/halt"), - require("./ast/identifier"), - require("./ast/if"), - require("./ast/include"), - require("./ast/inline"), - require("./ast/interface"), - require("./ast/isset"), - require("./ast/label"), - require("./ast/list"), - require("./ast/literal"), - require("./ast/lookup"), - require("./ast/magic"), - require("./ast/method"), - require("./ast/namespace"), - require("./ast/new"), - require("./ast/node"), - require("./ast/nowdoc"), - require("./ast/number"), - require("./ast/offsetlookup"), - require("./ast/operation"), - require("./ast/parameter"), - require("./ast/post"), - require("./ast/pre"), - require("./ast/print"), - require("./ast/program"), - require("./ast/property"), - require("./ast/propertylookup"), - require("./ast/retif"), - require("./ast/return"), - require("./ast/silent"), - require("./ast/statement"), - require("./ast/static"), - require("./ast/staticlookup"), - require("./ast/string"), - require("./ast/switch"), - require("./ast/sys"), - require("./ast/throw"), - require("./ast/trait"), - require("./ast/traitalias"), - require("./ast/traitprecedence"), - require("./ast/traituse"), - require("./ast/try"), - require("./ast/unary"), - require("./ast/unset"), - require("./ast/usegroup"), - require("./ast/useitem"), - require("./ast/variable"), - require("./ast/variadic"), - require("./ast/while"), - require("./ast/yield"), - require("./ast/yieldfrom") -].forEach(function(ctor) { - let kind = ctor.prototype.constructor.name.toLowerCase(); - if (kind[0] === "_") kind = kind.substring(1); - AST.prototype[kind] = ctor; -}); - -module.exports = AST; diff --git a/src/ast/array.js b/src/ast/array.js deleted file mode 100644 index 0941b880c..000000000 --- a/src/ast/array.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Expr = require("./expression"); -const KIND = "array"; - -/** - * Defines an array structure - * @constructor Array - * @example - * // PHP code : - * [1, 'foo' => 'bar', 3] - * - * // AST structure : - * { - * "kind": "array", - * "shortForm": true - * "items": [ - * {"kind": "number", "value": "1"}, - * { - * "kind": "entry", - * "key": {"kind": "string", "value": "foo", "isDoubleQuote": false}, - * "value": {"kind": "string", "value": "bar", "isDoubleQuote": false} - * }, - * {"kind": "number", "value": "3"} - * ] - * } - * @extends {Expression} - * @property {Entry|Expr|Variable} items List of array items - * @property {boolean} shortForm Indicate if the short array syntax is used, ex `[]` instead `array()` - */ -const Array = Expr.extends(function Array(shortForm, items, docs, location) { - Expr.apply(this, [KIND, docs, location]); - this.items = items; - this.shortForm = shortForm; -}); - -module.exports = Array; diff --git a/src/ast/assign.js b/src/ast/assign.js deleted file mode 100644 index 935c49e1f..000000000 --- a/src/ast/assign.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "assign"; - -/** - * Assigns a value to the specified target - * @constructor Assign - * @extends {Statement} - * @property {Expression} left - * @property {Expression} right - * @property {String} operator - */ -const Assign = Statement.extends(function Assign( - left, - right, - operator, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.operator = operator; - this.left = left; - this.right = right; -}); - -module.exports = Assign; diff --git a/src/ast/bin.js b/src/ast/bin.js deleted file mode 100644 index 59b7d0a81..000000000 --- a/src/ast/bin.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Operation = require("./operation"); -const KIND = "bin"; -/** - * Binary operations - * @constructor Bin - * @extends {Operation} - * @property {String} type - * @property {Expression} left - * @property {Expression} right - */ -const Bin = Operation.extends(function Bin(type, left, right, docs, location) { - Operation.apply(this, [KIND, docs, location]); - this.type = type; - this.left = left; - this.right = right; -}); - -module.exports = Bin; diff --git a/src/ast/block.js b/src/ast/block.js deleted file mode 100644 index 3b480e5ac..000000000 --- a/src/ast/block.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "block"; - -/** - * A block statement, i.e., a sequence of statements surrounded by braces. - * @constructor Block - * @extends {Statement} - * @property {Node[]} children - */ -const Block = Statement.extends(function Block(kind, children, docs, location) { - Statement.apply(this, [kind || KIND, docs, location]); - this.children = children.filter(Boolean); -}); - -module.exports = Block; diff --git a/src/ast/boolean.js b/src/ast/boolean.js deleted file mode 100644 index bdb5be539..000000000 --- a/src/ast/boolean.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Literal = require("./literal"); -const KIND = "boolean"; - -/** - * Defines a boolean value (true/false) - * @constructor Boolean - * @extends {Literal} - */ -const Boolean = Literal.extends(function Boolean(value, raw, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); -}); - -module.exports = Boolean; diff --git a/src/ast/break.js b/src/ast/break.js deleted file mode 100644 index fcc378305..000000000 --- a/src/ast/break.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "break"; - -/** - * A break statement - * @constructor Break - * @extends {Node} - * @property {Number|Null} level - */ -const Break = Node.extends(function Break(level, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.level = level; -}); - -module.exports = Break; diff --git a/src/ast/call.js b/src/ast/call.js deleted file mode 100644 index 7be69febb..000000000 --- a/src/ast/call.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "call"; - -/** - * Executes a call statement - * @constructor Call - * @extends {Statement} - * @property {Identifier|Variable|??} what - * @property {Arguments[]} arguments - */ -const Call = Statement.extends(function Call(what, args, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.what = what; - this.arguments = args; -}); - -module.exports = Call; diff --git a/src/ast/case.js b/src/ast/case.js deleted file mode 100644 index 850198fb5..000000000 --- a/src/ast/case.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "case"; - -/** - * A switch case statement - * @constructor Case - * @extends {Node} - * @property {Expression|null} test - if null, means that the default case - * @property {Block|null} body - */ -const Case = Node.extends(function Case(test, body, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.test = test; - this.body = body; -}); - -module.exports = Case; diff --git a/src/ast/cast.js b/src/ast/cast.js deleted file mode 100644 index 58e392c78..000000000 --- a/src/ast/cast.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Operation = require("./operation"); -const KIND = "cast"; - -/** - * Binary operations - * @constructor Cast - * @extends {Operation} - * @property {String} type - * @property {String} raw - * @property {Expression} what - */ -const Cast = Operation.extends(function Cast(type, raw, what, docs, location) { - Operation.apply(this, [KIND, docs, location]); - this.type = type; - this.raw = raw; - this.what = what; -}); - -module.exports = Cast; diff --git a/src/ast/catch.js b/src/ast/catch.js deleted file mode 100644 index e416b2126..000000000 --- a/src/ast/catch.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "catch"; - -/** - * Defines a catch statement - * @constructor Catch - * @extends {Statement} - * @property {Identifier[]} what - * @property {Variable} variable - * @property {Statement} body - * @see http://php.net/manual/en/language.exceptions.php - */ -const Catch = Statement.extends(function Catch( - body, - what, - variable, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.body = body; - this.what = what; - this.variable = variable; -}); - -module.exports = Catch; diff --git a/src/ast/class.js b/src/ast/class.js deleted file mode 100644 index 06296c0d7..000000000 --- a/src/ast/class.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Declaration = require("./declaration"); -const KIND = "class"; - -/** - * A class definition - * @constructor Class - * @extends {Declaration} - * @property {Identifier|null} extends - * @property {Identifier[]} implements - * @property {Declaration[]} body - * @property {boolean} isAnonymous - * @property {boolean} isAbstract - * @property {boolean} isFinal - */ -const Class = Declaration.extends(function Class( - name, - ext, - impl, - body, - flags, - docs, - location -) { - Declaration.apply(this, [KIND, name, docs, location]); - this.isAnonymous = name ? false : true; - this.extends = ext; - this.implements = impl; - this.body = body; - this.parseFlags(flags); -}); - -module.exports = Class; diff --git a/src/ast/classconstant.js b/src/ast/classconstant.js deleted file mode 100644 index 09d11cd6e..000000000 --- a/src/ast/classconstant.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Constant = require("./constant"); -const KIND = "classconstant"; - -/** - * Defines a class/interface/trait constant - * @constructor ClassConstant - * @extends {Constant} - * @property {boolean} isStatic - * @property {string} visibility - */ -const ClassConstant = Constant.extends(function ClassConstant( - name, - value, - flags, - docs, - location -) { - Constant.apply(this, [name, value, docs, location]); - this.kind = KIND; - this.parseFlags(flags); -}); - -module.exports = ClassConstant; diff --git a/src/ast/clone.js b/src/ast/clone.js deleted file mode 100644 index d5a59ff43..000000000 --- a/src/ast/clone.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "clone"; - -/** - * Defines a clone call - * @constructor Clone - * @extends {Statement} - * @property {Expression} what - */ -const Clone = Statement.extends(function Clone(what, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.what = what; -}); - -module.exports = Clone; diff --git a/src/ast/closure.js b/src/ast/closure.js deleted file mode 100644 index a74a8778b..000000000 --- a/src/ast/closure.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "closure"; - -/** - * Defines a closure - * @constructor Closure - * @extends {Statement} - * @property {Parameter[]} arguments - * @property {Variable[]} uses - * @property {Identifier} type - * @property {boolean} byref - * @property {boolean} nullable - * @property {Block|null} body - * @property {boolean} isStatic - */ -const Closure = Statement.extends(function Closure( - args, - byref, - uses, - type, - nullable, - isStatic, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.uses = uses; - this.arguments = args; - this.byref = byref; - this.type = type; - this.nullable = nullable; - this.isStatic = isStatic || false; - this.body = null; -}); - -module.exports = Closure; diff --git a/src/ast/comment.js b/src/ast/comment.js deleted file mode 100644 index cfebe473e..000000000 --- a/src/ast/comment.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); - -/** - * Abstract documentation node (ComentLine or CommentBlock) - * @constructor Comment - * @extends {Node} - * @property {String} value - */ -const Comment = Node.extends(function Comment(kind, value, docs, location) { - Node.apply(this, [kind, docs, location]); - this.value = value; -}); - -module.exports = Comment; diff --git a/src/ast/commentblock.js b/src/ast/commentblock.js deleted file mode 100644 index 2db59e200..000000000 --- a/src/ast/commentblock.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Comment = require("./comment"); -const KIND = "commentblock"; - -/** - * A comment block (multiline) - * @constructor CommentBlock - * @extends {Comment} - */ -const CommentBlock = Comment.extends(function CommentBlock( - value, - docs, - location -) { - Comment.apply(this, [KIND, value, docs, location]); -}); - -module.exports = CommentBlock; diff --git a/src/ast/commentline.js b/src/ast/commentline.js deleted file mode 100644 index af39f979e..000000000 --- a/src/ast/commentline.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Comment = require("./comment"); -const KIND = "commentline"; - -/** - * A single line comment - * @constructor CommentLine - * @extends {Comment} - */ -const CommentLine = Comment.extends(function CommentLine( - value, - docs, - location -) { - Comment.apply(this, [KIND, value, docs, location]); -}); - -module.exports = CommentLine; diff --git a/src/ast/constant.js b/src/ast/constant.js deleted file mode 100644 index 5d85eee32..000000000 --- a/src/ast/constant.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Declaration = require("./declaration"); -const KIND = "constant"; - -/** - * Defines a namespace constant - * @constructor Constant - * @extends {Declaration} - * @property {Node|null} value - */ -const Constant = Declaration.extends(function Constant( - name, - value, - docs, - location -) { - Declaration.apply(this, [KIND, name, docs, location]); - this.value = value; -}); - -module.exports = Constant; diff --git a/src/ast/constref.js b/src/ast/constref.js deleted file mode 100644 index fdb9e60eb..000000000 --- a/src/ast/constref.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Expr = require("./expression"); -const KIND = "constref"; - -/** - * A constant reference - * @constructor ConstRef - * @extends {Expression} - * @property {String|Node} name - */ -const ConstRef = Expr.extends(function ConstRef(identifier, docs, location) { - Expr.apply(this, [KIND, docs, location]); - this.name = identifier; -}); - -module.exports = ConstRef; diff --git a/src/ast/continue.js b/src/ast/continue.js deleted file mode 100644 index a76d4e56b..000000000 --- a/src/ast/continue.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "continue"; - -/** - * A continue statement - * @constructor Continue - * @extends {Node} - * @property {Number|Null} level - */ -const Continue = Node.extends(function Continue(level, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.level = level; -}); - -module.exports = Continue; diff --git a/src/ast/declaration.js b/src/ast/declaration.js deleted file mode 100644 index af8cf1f03..000000000 --- a/src/ast/declaration.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "declaration"; - -const IS_UNDEFINED = ""; -const IS_PUBLIC = "public"; -const IS_PROTECTED = "protected"; -const IS_PRIVATE = "private"; - -/** - * A declaration statement (function, class, interface...) - * @constructor Declaration - * @extends {Statement} - * @property {string} name - */ -const Declaration = Statement.extends(function Declaration( - kind, - name, - docs, - location -) { - Statement.apply(this, [kind || KIND, docs, location]); - this.name = name; -}); - -/** - * Generic flags parser - * @param {Integer[]} flags - * @return {void} - */ -Declaration.prototype.parseFlags = function(flags) { - this.isAbstract = flags[2] === 1; - this.isFinal = flags[2] === 2; - if (this.kind !== "class") { - if (flags[0] === -1) { - this.visibility = IS_UNDEFINED; - } else if (flags[0] === 0) { - this.visibility = IS_PUBLIC; - } else if (flags[0] === 1) { - this.visibility = IS_PROTECTED; - } else if (flags[0] === 2) { - this.visibility = IS_PRIVATE; - } - this.isStatic = flags[1] === 1; - } -}; - -module.exports = Declaration; diff --git a/src/ast/declare.js b/src/ast/declare.js deleted file mode 100644 index 376cc698b..000000000 --- a/src/ast/declare.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Block = require("./block"); -const KIND = "declare"; - -/** - * The declare construct is used to set execution directives for a block of code - * @constructor Declare - * @extends {Block} - * @property {Expression[]} what - * @property {String} mode - * @see http://php.net/manual/en/control-structures.declare.php - */ -const Declare = Block.extends(function Declare( - what, - body, - mode, - docs, - location -) { - Block.apply(this, [KIND, body, docs, location]); - this.what = what; - this.mode = mode; -}); - -/** - * The node is declared as a short tag syntax : - * ```php - * bar_$baz; - * ``` - * @constant {String} TYPE_OFFSET - `offset` - */ -Encapsed.TYPE_OFFSET = "offset"; - -module.exports = Encapsed; diff --git a/src/ast/entry.js b/src/ast/entry.js deleted file mode 100644 index 11805ac4e..000000000 --- a/src/ast/entry.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "entry"; - -/** - * An array entry - see [Array](#array) - * @constructor Entry - * @extends {Node} - * @property {Node|null} key The entry key/offset - * @property {Node} value The entry value - */ -const Entry = Node.extends(function Entry(key, value, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.key = key; - this.value = value; -}); - -module.exports = Entry; diff --git a/src/ast/error.js b/src/ast/error.js deleted file mode 100644 index be008d881..000000000 --- a/src/ast/error.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "error"; - -/** - * Defines an error node (used only on silentMode) - * @constructor Error - * @extends {Node} - * @property {string} message - * @property {number} line - * @property {number|string} token - * @property {string|array} expected - */ -const Error = Node.extends(function Error( - message, - token, - line, - expected, - docs, - location -) { - Node.apply(this, [KIND, docs, location]); - this.message = message; - this.token = token; - this.line = line; - this.expected = expected; -}); - -module.exports = Error; diff --git a/src/ast/eval.js b/src/ast/eval.js deleted file mode 100644 index eacc7c455..000000000 --- a/src/ast/eval.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "eval"; - -/** - * Defines an eval statement - * @constructor Eval - * @extends {Statement} - * @property {Node} source - */ -const Eval = Statement.extends(function Eval(source, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.source = source; -}); - -module.exports = Eval; diff --git a/src/ast/exit.js b/src/ast/exit.js deleted file mode 100644 index 7fad799d7..000000000 --- a/src/ast/exit.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "exit"; - -/** - * Defines an exit / die call - * @constructor Exit - * @extends {Statement} - * @property {Node|null} status - * @property {Boolean} useDie - */ -const Exit = Statement.extends(function Exit(status, useDie, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.status = status; - this.useDie = useDie; -}); - -module.exports = Exit; diff --git a/src/ast/expression.js b/src/ast/expression.js deleted file mode 100644 index 2fe9bfd41..000000000 --- a/src/ast/expression.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "expression"; - -/** - * Any expression node. Since the left-hand side of an assignment may - * be any expression in general, an expression can also be a pattern. - * @constructor Expression - * @extends {Node} - */ -const Expression = Node.extends(function Expression(kind, docs, location) { - Node.apply(this, [kind || KIND, docs, location]); -}); - -module.exports = Expression; diff --git a/src/ast/for.js b/src/ast/for.js deleted file mode 100644 index cba225f6e..000000000 --- a/src/ast/for.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "for"; - -/** - * Defines a for iterator - * @constructor For - * @extends {Statement} - * @property {Expression[]} init - * @property {Expression[]} test - * @property {Expression[]} increment - * @property {Statement} body - * @property {boolean} shortForm - * @see http://php.net/manual/en/control-structures.for.php - */ -const For = Statement.extends(function For( - init, - test, - increment, - body, - shortForm, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.init = init; - this.test = test; - this.increment = increment; - this.shortForm = shortForm; - this.body = body; -}); - -module.exports = For; diff --git a/src/ast/foreach.js b/src/ast/foreach.js deleted file mode 100644 index 8e64e91a1..000000000 --- a/src/ast/foreach.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "foreach"; - -/** - * Defines a foreach iterator - * @constructor Foreach - * @extends {Statement} - * @property {Expression} source - * @property {Expression|null} key - * @property {Expression} value - * @property {Statement} body - * @property {boolean} shortForm - * @see http://php.net/manual/en/control-structures.foreach.php - */ -const Foreach = Statement.extends(function Foreach( - source, - key, - value, - body, - shortForm, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.source = source; - this.key = key; - this.value = value; - this.shortForm = shortForm; - this.body = body; -}); - -module.exports = Foreach; diff --git a/src/ast/function.js b/src/ast/function.js deleted file mode 100644 index d07f088db..000000000 --- a/src/ast/function.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Declaration = require("./declaration"); -const KIND = "function"; - -/** - * Defines a classic function - * @constructor Function - * @extends {Declaration} - * @property {Parameter[]} arguments - * @property {Identifier} type - * @property {boolean} byref - * @property {boolean} nullable - * @property {Block|null} body - */ -const fn = Declaration.extends(function _Function( - name, - args, - byref, - type, - nullable, - docs, - location -) { - Declaration.apply(this, [KIND, name, docs, location]); - this.arguments = args; - this.byref = byref; - this.type = type; - this.nullable = nullable; - this.body = null; -}); -module.exports = fn; diff --git a/src/ast/global.js b/src/ast/global.js deleted file mode 100644 index 114049c75..000000000 --- a/src/ast/global.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "global"; - -/** - * Imports a variable from the global scope - * @constructor Global - * @extends {Statement} - * @property {Variable[]} items - */ -const Global = Statement.extends(function Global(items, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.items = items; -}); - -module.exports = Global; diff --git a/src/ast/goto.js b/src/ast/goto.js deleted file mode 100644 index 6b0eb3c5f..000000000 --- a/src/ast/goto.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "goto"; - -/** - * Defines goto statement - * @constructor Goto - * @extends {Statement} - * @property {String} label - * @see {Label} - */ -const Goto = Statement.extends(function Goto(label, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.label = label; -}); - -module.exports = Goto; diff --git a/src/ast/halt.js b/src/ast/halt.js deleted file mode 100644 index 8e4a65135..000000000 --- a/src/ast/halt.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "halt"; - -/** - * Halts the compiler execution - * @constructor Halt - * @extends {Statement} - * @property {String} after - String after the halt statement - * @see http://php.net/manual/en/function.halt-compiler.php - */ -const Halt = Statement.extends(function Halt(after, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.after = after; -}); - -module.exports = Halt; diff --git a/src/ast/identifier.js b/src/ast/identifier.js deleted file mode 100644 index 8a006b0cc..000000000 --- a/src/ast/identifier.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "identifier"; - -/** - * Defines an identifier node - * @constructor Identifier - * @extends {Node} - * @property {string} name - * @property {string} resolution - */ -const Identifier = Node.extends(function Identifier( - name, - isRelative, - docs, - location -) { - Node.apply(this, [KIND, docs, location]); - if (isRelative) { - this.resolution = Identifier.RELATIVE_NAME; - } else if (name.length === 1) { - this.resolution = Identifier.UNQUALIFIED_NAME; - } else if (name[0] === "") { - this.resolution = Identifier.FULL_QUALIFIED_NAME; - } else { - this.resolution = Identifier.QUALIFIED_NAME; - } - this.name = name.join("\\"); -}); - -/** - * This is an identifier without a namespace separator, such as Foo - * @constant {String} UNQUALIFIED_NAME - */ -Identifier.UNQUALIFIED_NAME = "uqn"; -/** - * This is an identifier with a namespace separator, such as Foo\Bar - * @constant {String} QUALIFIED_NAME - */ -Identifier.QUALIFIED_NAME = "qn"; -/** - * This is an identifier with a namespace separator that begins with - * a namespace separator, such as \Foo\Bar. The namespace \Foo is also - * a fully qualified name. - * @constant {String} FULL_QUALIFIED_NAME - */ -Identifier.FULL_QUALIFIED_NAME = "fqn"; -/** - * This is an identifier starting with namespace, such as namespace\Foo\Bar. - * @constant {String} RELATIVE_NAME - */ -Identifier.RELATIVE_NAME = "rn"; - -module.exports = Identifier; diff --git a/src/ast/if.js b/src/ast/if.js deleted file mode 100644 index 3d15b079e..000000000 --- a/src/ast/if.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "if"; - -/** - * Defines a if statement - * @constructor If - * @extends {Statement} - * @property {Expression} test - * @property {Block} body - * @property {Block|If|null} alternate - * @property {boolean} shortForm - */ -const If = Statement.extends(function If( - test, - body, - alternate, - shortForm, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.test = test; - this.body = body; - this.alternate = alternate; - this.shortForm = shortForm; -}); - -module.exports = If; diff --git a/src/ast/include.js b/src/ast/include.js deleted file mode 100644 index 1ea15aea5..000000000 --- a/src/ast/include.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "include"; - -/** - * Defines system include call - * @constructor Include - * @extends {Statement} - * @property {Node} target - * @property {boolean} once - * @property {boolean} require - */ -const Include = Statement.extends(function Include( - once, - require, - target, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.once = once; - this.require = require; - this.target = target; -}); - -module.exports = Include; diff --git a/src/ast/inline.js b/src/ast/inline.js deleted file mode 100644 index 3c3b34c45..000000000 --- a/src/ast/inline.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Literal = require("./literal"); -const KIND = "inline"; - -/** - * Defines inline html output (treated as echo output) - * @constructor Inline - * @extends {Literal} - */ -const Inline = Literal.extends(function Inline(value, raw, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); -}); - -module.exports = Inline; diff --git a/src/ast/interface.js b/src/ast/interface.js deleted file mode 100644 index 96a3c2c1f..000000000 --- a/src/ast/interface.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Declaration = require("./declaration"); -const KIND = "interface"; - -/** - * An interface definition - * @constructor Interface - * @extends {Declaration} - * @property {Identifier[]} extends - * @property {Declaration[]} body - */ -const Interface = Declaration.extends(function Interface( - name, - ext, - body, - docs, - location -) { - Declaration.apply(this, [KIND, name, docs, location]); - this.extends = ext; - this.body = body; -}); - -module.exports = Interface; diff --git a/src/ast/isset.js b/src/ast/isset.js deleted file mode 100644 index 01eeaa455..000000000 --- a/src/ast/isset.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Sys = require("./sys"); -const KIND = "isset"; - -/** - * Defines an isset call - * @constructor Isset - * @extends {Sys} - */ -const Isset = Sys.extends(function Isset(args, docs, location) { - Sys.apply(this, [KIND, args, docs, location]); -}); - -module.exports = Isset; diff --git a/src/ast/label.js b/src/ast/label.js deleted file mode 100644 index e7aed3fae..000000000 --- a/src/ast/label.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "label"; - -/** - * A label statement (referenced by goto) - * @constructor Label - * @extends {Node} - * @property {String} name - */ -const Label = Node.extends(function Label(name, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.name = name; -}); - -module.exports = Label; diff --git a/src/ast/list.js b/src/ast/list.js deleted file mode 100644 index 0fdbd7284..000000000 --- a/src/ast/list.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Sys = require("./sys"); -const KIND = "list"; - -/** - * Defines list assignment - * @constructor List - * @extends {Sys} - * @property {boolean} shortForm - */ -const List = Sys.extends(function List(items, shortForm, docs, location) { - Sys.apply(this, [KIND, items, docs, location]); - this.shortForm = shortForm; -}); - -module.exports = List; diff --git a/src/ast/literal.js b/src/ast/literal.js deleted file mode 100644 index be901f953..000000000 --- a/src/ast/literal.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Expr = require("./expression"); -const KIND = "literal"; - -/** - * Defines an array structure - * @constructor Literal - * @extends {Expression} - * @property {string} raw - * @property {Node|string|number|boolean|null} value - */ -const Literal = Expr.extends(function Literal( - kind, - value, - raw, - docs, - location -) { - Expr.apply(this, [kind || KIND, docs, location]); - this.value = value; - if (raw) { - this.raw = raw; - } -}); - -module.exports = Literal; diff --git a/src/ast/location.js b/src/ast/location.js deleted file mode 100644 index a0f5f46de..000000000 --- a/src/ast/location.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -/** - * Defines the location of the node (with it's source contents as string) - * @constructor Location - * @property {String|null} source - * @property {Position} start - * @property {Position} end - */ -const Location = function(source, start, end) { - this.source = source; - this.start = start; - this.end = end; -}; - -module.exports = Location; diff --git a/src/ast/lookup.js b/src/ast/lookup.js deleted file mode 100644 index 71278704e..000000000 --- a/src/ast/lookup.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Expr = require("./expression"); -const KIND = "lookup"; - -/** - * Lookup on an offset in the specified object - * @constructor Lookup - * @extends {Expression} - * @property {Expression} what - * @property {Expression} offset - */ -const Lookup = Expr.extends(function Lookup( - kind, - what, - offset, - docs, - location -) { - Expr.apply(this, [kind || KIND, docs, location]); - this.what = what; - this.offset = offset; -}); - -module.exports = Lookup; diff --git a/src/ast/magic.js b/src/ast/magic.js deleted file mode 100644 index a3329b484..000000000 --- a/src/ast/magic.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Literal = require("./literal"); -const KIND = "magic"; - -/** - * Defines magic constant - * @constructor Magic - * @extends {Literal} - */ -const Magic = Literal.extends(function Magic(value, raw, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); -}); - -module.exports = Magic; diff --git a/src/ast/method.js b/src/ast/method.js deleted file mode 100644 index 045bd85cd..000000000 --- a/src/ast/method.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const fn = require("./function"); -const KIND = "method"; - -/** - * Defines a class/interface/trait method - * @constructor Method - * @extends {Function} - * @property {boolean} isAbstract - * @property {boolean} isFinal - * @property {boolean} isStatic - * @property {string} visibility - */ -const Method = fn.extends(function Method() { - fn.apply(this, arguments); - this.kind = KIND; -}); - -module.exports = Method; diff --git a/src/ast/namespace.js b/src/ast/namespace.js deleted file mode 100644 index 2a4d41d2b..000000000 --- a/src/ast/namespace.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Block = require("./block"); -const KIND = "namespace"; - -/** - * The main program node - * @constructor Namespace - * @extends {Block} - * @property {String} name - * @property {Boolean} withBrackets - */ -const Namespace = Block.extends(function Namespace( - name, - children, - withBrackets, - docs, - location -) { - Block.apply(this, [KIND, children, docs, location]); - this.name = name; - this.withBrackets = withBrackets || false; -}); - -module.exports = Namespace; diff --git a/src/ast/new.js b/src/ast/new.js deleted file mode 100644 index 49b7a2123..000000000 --- a/src/ast/new.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "new"; - -/** - * Creates a new instance of the specified class - * @constructor New - * @extends {Statement} - * @property {Identifier|Variable|Class} what - * @property {Arguments[]} arguments - */ -const New = Statement.extends(function New(what, args, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.what = what; - this.arguments = args; -}); - -module.exports = New; diff --git a/src/ast/node.js b/src/ast/node.js deleted file mode 100644 index 907851363..000000000 --- a/src/ast/node.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -/** - * A generic AST node - * @constructor Node - * @property {Location|null} loc - * @property {Comment[]} leadingComments - * @property {Comment[]?} trailingComments - * @property {String} kind - */ -const Node = function Node(kind, docs, location) { - this.kind = kind; - if (docs) { - this.leadingComments = docs; - } - if (location) { - this.loc = location; - } -}; - -/** - * Includes current token position of the parser - * @param {*} parser - */ -Node.prototype.includeToken = function(parser) { - if (this.loc) { - if (this.loc.end) { - this.loc.end.line = parser.lexer.yylloc.last_line; - this.loc.end.column = parser.lexer.yylloc.last_column; - this.loc.end.offset = parser.lexer.offset; - } - if (parser.ast.withSource) { - this.loc.source = parser.lexer._input.substring( - this.loc.start.offset, - parser.lexer.offset - ); - } - } - return this; -}; - -/** - * Helper for extending the Node class - * @param {Function} constructor - * @return {Function} - */ -Node.extends = function(constructor) { - constructor.prototype = Object.create(this.prototype); - constructor.extends = this.extends; - constructor.prototype.constructor = constructor; - return constructor; -}; - -module.exports = Node; diff --git a/src/ast/nowdoc.js b/src/ast/nowdoc.js deleted file mode 100644 index c26194caa..000000000 --- a/src/ast/nowdoc.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Literal = require("./literal"); -const KIND = "nowdoc"; - -/** - * Defines a nowdoc string - * @constructor String - * @extends {Literal} - * @property {String} label - * @property {String} raw - * @property {Boolean} quote - */ -const Nowdoc = Literal.extends(function Nowdoc( - value, - raw, - label, - quote, - docs, - location -) { - Literal.apply(this, [KIND, value, raw, docs, location]); - this.label = label; - this.quote = quote; -}); - -module.exports = Nowdoc; diff --git a/src/ast/number.js b/src/ast/number.js deleted file mode 100644 index dd51dfe70..000000000 --- a/src/ast/number.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Literal = require("./literal"); -const KIND = "number"; - -/** - * Defines a numeric value - * @constructor Number - * @extends {Literal} - */ -const _Number = Literal.extends(function Number(value, raw, docs, location) { - Literal.apply(this, [KIND, value, raw, docs, location]); -}); - -module.exports = _Number; diff --git a/src/ast/offsetlookup.js b/src/ast/offsetlookup.js deleted file mode 100644 index aeb4b98fa..000000000 --- a/src/ast/offsetlookup.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Lookup = require("./lookup"); -const KIND = "offsetlookup"; - -/** - * Lookup on an offset in an array - * @constructor OffsetLookup - * @extends {Lookup} - */ -const OffsetLookup = Lookup.extends(function OffsetLookup( - what, - offset, - docs, - location -) { - Lookup.apply(this, [KIND, what, offset, docs, location]); -}); - -module.exports = OffsetLookup; diff --git a/src/ast/operation.js b/src/ast/operation.js deleted file mode 100644 index 4cf9c34f1..000000000 --- a/src/ast/operation.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Expr = require("./expression"); -const KIND = "operation"; - -/** - * Defines binary operations - * @constructor Operation - * @extends {Expression} - */ -const Operation = Expr.extends(function Operation(kind, docs, location) { - Expr.apply(this, [kind || KIND, docs, location]); -}); - -module.exports = Operation; diff --git a/src/ast/parameter.js b/src/ast/parameter.js deleted file mode 100644 index ea5d880d2..000000000 --- a/src/ast/parameter.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Declaration = require("./declaration"); -const KIND = "parameter"; - -/** - * Defines a function parameter - * @constructor Parameter - * @extends {Declaration} - * @property {Identifier|null} type - * @property {Node|null} value - * @property {boolean} byref - * @property {boolean} variadic - * @property {boolean} nullable - */ -const Parameter = Declaration.extends(function Parameter( - name, - type, - value, - isRef, - isVariadic, - nullable, - docs, - location -) { - Declaration.apply(this, [KIND, name, docs, location]); - this.value = value; - this.type = type; - this.byref = isRef; - this.variadic = isVariadic; - this.nullable = nullable; -}); - -module.exports = Parameter; diff --git a/src/ast/position.js b/src/ast/position.js deleted file mode 100644 index bb08cd811..000000000 --- a/src/ast/position.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -/** - * Each Position object consists of a line number (1-indexed) and a column number (0-indexed): - * @constructor Position - * @property {Number} line - * @property {Number} column - * @property {Number} offset - */ -const Position = function(line, column, offset) { - this.line = line; - this.column = column; - this.offset = offset; -}; - -module.exports = Position; diff --git a/src/ast/post.js b/src/ast/post.js deleted file mode 100644 index f8e0bdf70..000000000 --- a/src/ast/post.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Operation = require("./operation"); -const KIND = "post"; - -/** - * Defines a post operation `$i++` or `$i--` - * @constructor Post - * @extends {Operation} - * @property {String} type - * @property {Variable} what - */ -const Post = Operation.extends(function Post(type, what, docs, location) { - Operation.apply(this, [KIND, docs, location]); - this.type = type; - this.what = what; -}); - -module.exports = Post; diff --git a/src/ast/pre.js b/src/ast/pre.js deleted file mode 100644 index afb11e588..000000000 --- a/src/ast/pre.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Operation = require("./operation"); -const KIND = "pre"; - -/** - * Defines a pre operation `++$i` or `--$i` - * @constructor Pre - * @extends {Operation} - * @property {String} type - * @property {Variable} what - */ -const Pre = Operation.extends(function Pre(type, what, docs, location) { - Operation.apply(this, [KIND, docs, location]); - this.type = type; - this.what = what; -}); - -module.exports = Pre; diff --git a/src/ast/print.js b/src/ast/print.js deleted file mode 100644 index 08c9f31f3..000000000 --- a/src/ast/print.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Sys = require("./sys"); -const KIND = "print"; - -/** - * Outputs - * @constructor Print - * @extends {Sys} - */ -const Print = Sys.extends(function Print(args, docs, location) { - Sys.apply(this, [KIND, args, docs, location]); -}); - -module.exports = Print; diff --git a/src/ast/program.js b/src/ast/program.js deleted file mode 100644 index 0ecaa949c..000000000 --- a/src/ast/program.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Block = require("./block"); -const KIND = "program"; - -/** - * The main program node - * @constructor Program - * @extends {Block} - * @property {Error[]} errors - * @property {Doc[]?} comments - * @property {String[]?} tokens - */ -const Program = Block.extends(function Program( - children, - errors, - comments, - tokens, - docs, - location -) { - Block.apply(this, [KIND, children, docs, location]); - this.errors = errors; - if (comments) { - this.comments = comments; - } - if (tokens) { - this.tokens = tokens; - } -}); - -module.exports = Program; diff --git a/src/ast/property.js b/src/ast/property.js deleted file mode 100644 index 17d3a77cd..000000000 --- a/src/ast/property.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Declaration = require("./declaration"); -const KIND = "property"; - -/** - * Defines a class property - * @constructor Property - * @extends {Declaration} - * @property {boolean} isFinal - * @property {boolean} isStatic - * @property {string} visibility - * @property {Node|null} value - */ -const Property = Declaration.extends(function Property( - name, - value, - flags, - docs, - location -) { - Declaration.apply(this, [KIND, name, docs, location]); - this.value = value; - this.parseFlags(flags); -}); - -module.exports = Property; diff --git a/src/ast/propertylookup.js b/src/ast/propertylookup.js deleted file mode 100644 index b05f82b80..000000000 --- a/src/ast/propertylookup.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Lookup = require("./lookup"); -const KIND = "propertylookup"; - -/** - * Lookup to an object property - * @constructor PropertyLookup - * @extends {Lookup} - */ -const PropertyLookup = Lookup.extends(function PropertyLookup( - what, - offset, - docs, - location -) { - Lookup.apply(this, [KIND, what, offset, docs, location]); -}); - -module.exports = PropertyLookup; diff --git a/src/ast/retif.js b/src/ast/retif.js deleted file mode 100644 index da6def606..000000000 --- a/src/ast/retif.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "retif"; - -/** - * Defines a short if statement that returns a value - * @constructor RetIf - * @extends {Statement} - * @property {Expression} test - * @property {Expression} trueExpr - * @property {Expression} falseExpr - */ -const RetIf = Statement.extends(function RetIf( - test, - trueExpr, - falseExpr, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.test = test; - this.trueExpr = trueExpr; - this.falseExpr = falseExpr; -}); - -module.exports = RetIf; diff --git a/src/ast/return.js b/src/ast/return.js deleted file mode 100644 index 8e77ed39a..000000000 --- a/src/ast/return.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "return"; - -/** - * A continue statement - * @constructor Return - * @extends {Node} - * @property {Expression|null} expr - */ -const Return = Node.extends(function Return(expr, docs, location) { - Node.apply(this, [KIND, docs, location]); - this.expr = expr; -}); - -module.exports = Return; diff --git a/src/ast/silent.js b/src/ast/silent.js deleted file mode 100644 index 927232b15..000000000 --- a/src/ast/silent.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "silent"; - -/** - * Avoids to show/log warnings & notices from the inner expression - * @constructor Silent - * @extends {Statement} - * @property {Expression} expr - */ -const Silent = Statement.extends(function Silent(expr, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.expr = expr; -}); - -module.exports = Silent; diff --git a/src/ast/statement.js b/src/ast/statement.js deleted file mode 100644 index 9cd96c35b..000000000 --- a/src/ast/statement.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "statement"; - -/** - * Any statement. - * @constructor Statement - * @extends {Node} - */ -const Statement = Node.extends(function Statement(kind, docs, location) { - Node.apply(this, [kind || KIND, docs, location]); -}); - -module.exports = Statement; diff --git a/src/ast/static.js b/src/ast/static.js deleted file mode 100644 index b31e6c975..000000000 --- a/src/ast/static.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "static"; - -/** - * Declares a static variable into the current scope - * @constructor Static - * @extends {Statement} - * @property {Variable[]|Assign[]} items - */ -const Static = Statement.extends(function Static(items, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.items = items; -}); - -module.exports = Static; diff --git a/src/ast/staticlookup.js b/src/ast/staticlookup.js deleted file mode 100644 index aeef1c3ec..000000000 --- a/src/ast/staticlookup.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Lookup = require("./lookup"); -const KIND = "staticlookup"; - -/** - * Lookup to a static property - * @constructor StaticLookup - * @extends {Lookup} - */ -const StaticLookup = Lookup.extends(function StaticLookup( - what, - offset, - docs, - location -) { - Lookup.apply(this, [KIND, what, offset, docs, location]); -}); - -module.exports = StaticLookup; diff --git a/src/ast/string.js b/src/ast/string.js deleted file mode 100644 index e5a625cd4..000000000 --- a/src/ast/string.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Literal = require("./literal"); -const KIND = "string"; - -/** - * Defines a string (simple ou double quoted) - chars are already escaped - * @constructor String - * @extends {Literal} - * @property {boolean} unicode - * @property {boolean} isDoubleQuote - * @see {Encapsed} - */ -const String = Literal.extends(function String( - isDoubleQuote, - value, - unicode, - raw, - docs, - location -) { - Literal.apply(this, [KIND, value, raw, docs, location]); - this.unicode = unicode; - this.isDoubleQuote = isDoubleQuote; -}); - -module.exports = String; diff --git a/src/ast/switch.js b/src/ast/switch.js deleted file mode 100644 index 3d9932468..000000000 --- a/src/ast/switch.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "switch"; - -/** - * Defines a switch statement - * @constructor Switch - * @extends {Statement} - * @property {Expression} test - * @property {Block} body - * @property {boolean} shortForm - */ -const Switch = Statement.extends(function Switch( - test, - body, - shortForm, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.test = test; - this.body = body; - this.shortForm = shortForm; -}); - -module.exports = Switch; diff --git a/src/ast/sys.js b/src/ast/sys.js deleted file mode 100644 index 747862309..000000000 --- a/src/ast/sys.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "sys"; - -/** - * Defines system based call - * @constructor Sys - * @extends {Statement} - * @property {Node[]} arguments - */ -const Sys = Statement.extends(function Sys(kind, args, docs, location) { - Statement.apply(this, [kind || KIND, docs, location]); - this.arguments = args; -}); - -module.exports = Sys; diff --git a/src/ast/throw.js b/src/ast/throw.js deleted file mode 100644 index 92797f61a..000000000 --- a/src/ast/throw.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "throw"; - -/** - * Defines a throw statement - * @constructor Throw - * @extends {Statement} - * @property {Expression} what - */ -const Throw = Statement.extends(function Throw(what, docs, location) { - Statement.apply(this, [KIND, docs, location]); - this.what = what; -}); - -module.exports = Throw; diff --git a/src/ast/trait.js b/src/ast/trait.js deleted file mode 100644 index 07a7b51e8..000000000 --- a/src/ast/trait.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Declaration = require("./declaration"); -const KIND = "trait"; - -/** - * A trait definition - * @constructor Trait - * @extends {Declaration} - * @property {Identifier|null} extends - * @property {Identifier[]} implements - * @property {Declaration[]} body - */ -const Trait = Declaration.extends(function Trait( - name, - ext, - impl, - body, - docs, - location -) { - Declaration.apply(this, [KIND, name, docs, location]); - this.extends = ext; - this.implements = impl; - this.body = body; -}); - -module.exports = Trait; diff --git a/src/ast/traitalias.js b/src/ast/traitalias.js deleted file mode 100644 index a8df69a03..000000000 --- a/src/ast/traitalias.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "traitalias"; - -const IS_UNDEFINED = ""; -const IS_PUBLIC = "public"; -const IS_PROTECTED = "protected"; -const IS_PRIVATE = "private"; - -/** - * Defines a trait alias - * @constructor TraitAlias - * @extends {Node} - * @property {Identifier|null} trait - * @property {string} method - * @property {string|null} as - * @property {string|null} visibility - */ -const TraitAlias = Node.extends(function TraitAlias( - trait, - method, - as, - flags, - docs, - location -) { - Node.apply(this, [KIND, docs, location]); - this.trait = trait; - this.method = method; - this.as = as; - this.visibility = IS_UNDEFINED; - if (flags) { - if (flags[0] === 0) { - this.visibility = IS_PUBLIC; - } else if (flags[0] === 1) { - this.visibility = IS_PROTECTED; - } else if (flags[0] === 2) { - this.visibility = IS_PRIVATE; - } - } -}); - -module.exports = TraitAlias; diff --git a/src/ast/traitprecedence.js b/src/ast/traitprecedence.js deleted file mode 100644 index 8e3841d5f..000000000 --- a/src/ast/traitprecedence.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "traitprecedence"; - -/** - * Defines a trait alias - * @constructor TraitPrecedence - * @extends {Node} - * @property {Identifier|null} trait - * @property {string} method - * @property {Identifier[]} instead - */ -const TraitPrecedence = Node.extends(function TraitPrecedence( - trait, - method, - instead, - docs, - location -) { - Node.apply(this, [KIND, docs, location]); - this.trait = trait; - this.method = method; - this.instead = instead; -}); - -module.exports = TraitPrecedence; diff --git a/src/ast/traituse.js b/src/ast/traituse.js deleted file mode 100644 index 5d130258f..000000000 --- a/src/ast/traituse.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Node = require("./node"); -const KIND = "traituse"; - -/** - * Defines a trait usage - * @constructor TraitUse - * @extends {Node} - * @property {Identifier[]} traits - * @property {Node[]|null} adaptations - */ -const TraitUse = Node.extends(function TraitUse( - traits, - adaptations, - docs, - location -) { - Node.apply(this, [KIND, docs, location]); - this.traits = traits; - this.adaptations = adaptations; -}); - -module.exports = TraitUse; diff --git a/src/ast/try.js b/src/ast/try.js deleted file mode 100644 index b44ddabb2..000000000 --- a/src/ast/try.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "try"; - -/** - * Defines a try statement - * @constructor Try - * @extends {Statement} - * @property {Block} body - * @property {Catch[]} catches - * @property {Block} allways - */ -const Try = Statement.extends(function Try( - body, - catches, - always, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.body = body; - this.catches = catches; - this.always = always; -}); - -module.exports = Try; diff --git a/src/ast/unary.js b/src/ast/unary.js deleted file mode 100644 index d94dd7fa0..000000000 --- a/src/ast/unary.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Operation = require("./operation"); -const KIND = "unary"; - -/** - * Unary operations - * @constructor Unary - * @extends {Operation} - * @property {String} type - * @property {Expression} what - */ -const Unary = Operation.extends(function Unary(type, what, docs, location) { - Operation.apply(this, [KIND, docs, location]); - this.type = type; - this.what = what; -}); - -module.exports = Unary; diff --git a/src/ast/unset.js b/src/ast/unset.js deleted file mode 100644 index 69fe65702..000000000 --- a/src/ast/unset.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Sys = require("./sys"); -const KIND = "unset"; - -/** - * Deletes references to a list of variables - * @constructor Unset - * @extends {Sys} - */ -const Unset = Sys.extends(function Unset(args, docs, location) { - Sys.apply(this, [KIND, args, docs, location]); -}); - -module.exports = Unset; diff --git a/src/ast/usegroup.js b/src/ast/usegroup.js deleted file mode 100644 index f790b6a89..000000000 --- a/src/ast/usegroup.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "usegroup"; - -/** - * Defines a use statement (with a list of use items) - * @constructor UseGroup - * @extends {Statement} - * @property {String|null} name - * @property {String|null} type - Possible value : function, const - * @property {UseItem[]} item - * @see {Namespace} - * @see http://php.net/manual/en/language.namespaces.importing.php - */ -const UseGroup = Statement.extends(function UseGroup( - name, - type, - items, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.name = name; - this.type = type; - this.items = items; -}); - -module.exports = UseGroup; diff --git a/src/ast/useitem.js b/src/ast/useitem.js deleted file mode 100644 index 83644a097..000000000 --- a/src/ast/useitem.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "useitem"; - -/** - * Defines a use statement (from namespace) - * @constructor UseItem - * @extends {Statement} - * @property {String} name - * @property {String|null} type - Possible value : function, const - * @property {String|null} alias - * @see {Namespace} - * @see http://php.net/manual/en/language.namespaces.importing.php - */ -const UseItem = Statement.extends(function UseItem( - name, - alias, - type, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.name = name; - this.alias = alias; - this.type = type; -}); - -/** - * Importing a constant - * @constant {String} TYPE_CONST - */ -UseItem.TYPE_CONST = "const"; -/** - * Importing a function - * @constant {String} TYPE_FUNC - */ -UseItem.TYPE_FUNCTION = "function"; - -module.exports = UseItem; diff --git a/src/ast/variable.js b/src/ast/variable.js deleted file mode 100644 index a68f736c0..000000000 --- a/src/ast/variable.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Expr = require("./expression"); -const KIND = "variable"; - -/** - * Any expression node. Since the left-hand side of an assignment may - * be any expression in general, an expression can also be a pattern. - * @constructor Variable - * @extends {Expression} - * @example - * // PHP code : - * &$foo - * // AST output - * { - * "kind": "variable", - * "name": "foo", - * "byref": true, - * "curly": false - * } - * @property {String|Node} name The variable name (can be a complex expression when the name is resolved dynamically) - * @property {boolean} byref Indicate if the variable reference is used, ex `&$foo` - * @property {boolean} curly Indicate if the name is defined between curlies, ex `${foo}` - */ -const Variable = Expr.extends(function Variable( - name, - byref, - curly, - docs, - location -) { - Expr.apply(this, [KIND, docs, location]); - this.name = name; - this.byref = byref || false; - this.curly = curly || false; -}); - -module.exports = Variable; diff --git a/src/ast/variadic.js b/src/ast/variadic.js deleted file mode 100644 index f9eced6e6..000000000 --- a/src/ast/variadic.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Expr = require("./expression"); -const KIND = "variadic"; - -/** - * Introduce a list of items into the arguments of the call - * @constructor variadic - * @extends {Expression} - * @property {Array|Expression} what - * @see https://wiki.php.net/rfc/argument_unpacking - */ -const variadic = Expr.extends(function variadic(what, docs, location) { - Expr.apply(this, [KIND, docs, location]); - this.what = what; -}); - -module.exports = variadic; diff --git a/src/ast/while.js b/src/ast/while.js deleted file mode 100644 index 1e200a4cb..000000000 --- a/src/ast/while.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Statement = require("./statement"); -const KIND = "while"; - -/** - * Defines a while statement - * @constructor While - * @extends {Statement} - * @property {Expression} test - * @property {Statement} body - * @property {boolean} shortForm - */ -const While = Statement.extends(function While( - test, - body, - shortForm, - docs, - location -) { - Statement.apply(this, [KIND, docs, location]); - this.test = test; - this.body = body; - this.shortForm = shortForm; -}); - -module.exports = While; diff --git a/src/ast/yield.js b/src/ast/yield.js deleted file mode 100644 index c0e2e28d4..000000000 --- a/src/ast/yield.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Expression = require("./expression"); -const KIND = "yield"; - -/** - * Defines a yield generator statement - * @constructor Yield - * @extends {Expression} - * @property {Expression|Null} value - * @property {Expression|Null} key - * @see http://php.net/manual/en/language.generators.syntax.php - */ -const Yield = Expression.extends(function Yield(value, key, docs, location) { - Expression.apply(this, [KIND, docs, location]); - this.value = value; - this.key = key; -}); - -module.exports = Yield; diff --git a/src/ast/yieldfrom.js b/src/ast/yieldfrom.js deleted file mode 100644 index 54fa97395..000000000 --- a/src/ast/yieldfrom.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const Expression = require("./expression"); -const KIND = "yieldfrom"; - -/** - * Defines a yield from generator statement - * @constructor YieldFrom - * @extends {Expression} - * @property {Expression} value - * @see http://php.net/manual/en/language.generators.syntax.php - */ -const YieldFrom = Expression.extends(function YieldFrom(value, docs, location) { - Expression.apply(this, [KIND, docs, location]); - this.value = value; -}); - -module.exports = YieldFrom; diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 44b33bb7c..000000000 --- a/src/index.js +++ /dev/null @@ -1,216 +0,0 @@ -/*! - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const lexer = require("./lexer"); -const parser = require("./parser"); -const tokens = require("./tokens"); -const AST = require("./ast"); - -/** - * @private - */ -function combine(src, to) { - const keys = Object.keys(src); - let i = keys.length; - while (i--) { - const k = keys[i]; - const val = src[k]; - if (val === null) { - delete to[k]; - } else if (typeof val === "function") { - to[k] = val.bind(to); - } else if (Array.isArray(val)) { - to[k] = Array.isArray(to[k]) ? to[k].concat(val) : val; - } else if (typeof val === "object") { - to[k] = typeof to[k] === "object" ? combine(val, to[k]) : val; - } else { - to[k] = val; - } - } - return to; -} - -/** - * Initialise a new parser instance with the specified options - * - * @class - * @tutorial Engine - * @example - * var parser = require('php-parser'); - * var instance = new parser({ - * parser: { - * extractDoc: true, - * suppressErrors: true, - * php7: true - * }, - * ast: { - * withPositions: true - * }, - * lexer: { - * short_tags: true, - * asp_tags: true - * } - * }); - * - * var evalAST = instance.parseEval('some php code'); - * var codeAST = instance.parseCode(' Note that the output tokens are *STRICLY* similar to PHP function `token_get_all` - * @param {String} buffer - * @return {String[]} - Each item can be a string or an array with following informations [token_name, text, line_number] - */ -engine.prototype.tokenGetAll = function(buffer) { - this.lexer.mode_eval = false; - this.lexer.all_tokens = true; - buffer = getStringBuffer(buffer); - const EOF = this.lexer.EOF; - const names = this.tokens.values; - this.lexer.setInput(buffer); - let token = this.lexer.lex() || EOF; - const result = []; - while (token != EOF) { - let entry = this.lexer.yytext; - if (names.hasOwnProperty(token)) { - entry = [names[token], entry, this.lexer.yylloc.first_line]; - } - result.push(entry); - token = this.lexer.lex() || EOF; - } - return result; -}; - -// exports the function -module.exports = engine; - -// makes libraries public -module.exports.tokens = tokens; -module.exports.lexer = lexer; -module.exports.AST = AST; -module.exports.parser = parser; -module.exports.combine = combine; - -// allow the default export in index.d.ts -module.exports.default = engine; diff --git a/src/lexer.js b/src/lexer.js deleted file mode 100644 index 0254082d9..000000000 --- a/src/lexer.js +++ /dev/null @@ -1,461 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -/** - * This is the php lexer. It will tokenize the string for helping the - * parser to build the AST from its grammar. - * - * @class - * @property {Integer} EOF - * @property {Boolean} all_tokens defines if all tokens must be retrieved (used by token_get_all only) - * @property {Boolean} comment_tokens extracts comments tokens - * @property {Boolean} mode_eval enables the evald mode (ignore opening tags) - * @property {Boolean} asp_tags disables by default asp tags mode - * @property {Boolean} short_tags enables by default short tags mode - * @property {Object} keywords List of php keyword - * @property {Object} castKeywords List of php keywords for type casting - */ -const lexer = function(engine) { - this.engine = engine; - this.tok = this.engine.tokens.names; - this.EOF = 1; - this.debug = false; - this.all_tokens = true; - this.comment_tokens = false; - this.mode_eval = false; - this.asp_tags = false; - this.short_tags = true; - this.php7 = true; - this.yyprevcol = 0; - this.keywords = { - __class__: this.tok.T_CLASS_C, - __trait__: this.tok.T_TRAIT_C, - __function__: this.tok.T_FUNC_C, - __method__: this.tok.T_METHOD_C, - __line__: this.tok.T_LINE, - __file__: this.tok.T_FILE, - __dir__: this.tok.T_DIR, - __namespace__: this.tok.T_NS_C, - exit: this.tok.T_EXIT, - die: this.tok.T_EXIT, - function: this.tok.T_FUNCTION, - const: this.tok.T_CONST, - return: this.tok.T_RETURN, - try: this.tok.T_TRY, - catch: this.tok.T_CATCH, - finally: this.tok.T_FINALLY, - throw: this.tok.T_THROW, - if: this.tok.T_IF, - elseif: this.tok.T_ELSEIF, - endif: this.tok.T_ENDIF, - else: this.tok.T_ELSE, - while: this.tok.T_WHILE, - endwhile: this.tok.T_ENDWHILE, - do: this.tok.T_DO, - for: this.tok.T_FOR, - endfor: this.tok.T_ENDFOR, - foreach: this.tok.T_FOREACH, - endforeach: this.tok.T_ENDFOREACH, - declare: this.tok.T_DECLARE, - enddeclare: this.tok.T_ENDDECLARE, - instanceof: this.tok.T_INSTANCEOF, - as: this.tok.T_AS, - switch: this.tok.T_SWITCH, - endswitch: this.tok.T_ENDSWITCH, - case: this.tok.T_CASE, - default: this.tok.T_DEFAULT, - break: this.tok.T_BREAK, - continue: this.tok.T_CONTINUE, - goto: this.tok.T_GOTO, - echo: this.tok.T_ECHO, - print: this.tok.T_PRINT, - class: this.tok.T_CLASS, - interface: this.tok.T_INTERFACE, - trait: this.tok.T_TRAIT, - extends: this.tok.T_EXTENDS, - implements: this.tok.T_IMPLEMENTS, - new: this.tok.T_NEW, - clone: this.tok.T_CLONE, - var: this.tok.T_VAR, - eval: this.tok.T_EVAL, - include: this.tok.T_INCLUDE, - include_once: this.tok.T_INCLUDE_ONCE, - require: this.tok.T_REQUIRE, - require_once: this.tok.T_REQUIRE_ONCE, - namespace: this.tok.T_NAMESPACE, - use: this.tok.T_USE, - insteadof: this.tok.T_INSTEADOF, - global: this.tok.T_GLOBAL, - isset: this.tok.T_ISSET, - empty: this.tok.T_EMPTY, - __halt_compiler: this.tok.T_HALT_COMPILER, - static: this.tok.T_STATIC, - abstract: this.tok.T_ABSTRACT, - final: this.tok.T_FINAL, - private: this.tok.T_PRIVATE, - protected: this.tok.T_PROTECTED, - public: this.tok.T_PUBLIC, - unset: this.tok.T_UNSET, - list: this.tok.T_LIST, - array: this.tok.T_ARRAY, - callable: this.tok.T_CALLABLE, - or: this.tok.T_LOGICAL_OR, - and: this.tok.T_LOGICAL_AND, - xor: this.tok.T_LOGICAL_XOR - }; - this.castKeywords = { - int: this.tok.T_INT_CAST, - integer: this.tok.T_INT_CAST, - real: this.tok.T_DOUBLE_CAST, - double: this.tok.T_DOUBLE_CAST, - float: this.tok.T_DOUBLE_CAST, - string: this.tok.T_STRING_CAST, - binary: this.tok.T_STRING_CAST, - array: this.tok.T_ARRAY_CAST, - object: this.tok.T_OBJECT_CAST, - bool: this.tok.T_BOOL_CAST, - boolean: this.tok.T_BOOL_CAST, - unset: this.tok.T_UNSET_CAST - }; -}; - -/** - * Initialize the lexer with the specified input - */ -lexer.prototype.setInput = function(input) { - this._input = input; - this.size = input.length; - this.yylineno = 1; - this.offset = 0; - this.yyprevcol = 0; - this.yytext = ""; - this.yylloc = { - first_offset: 0, - first_line: 1, - first_column: 0, - prev_offset: 0, - prev_line: 1, - prev_column: 0, - last_line: 1, - last_column: 0 - }; - this.tokens = []; - this.done = this.offset >= this.size; - if (!this.all_tokens && this.mode_eval) { - this.conditionStack = ["INITIAL"]; - this.begin("ST_IN_SCRIPTING"); - } else { - this.conditionStack = []; - this.begin("INITIAL"); - } - return this; -}; - -/** - * consumes and returns one char from the input - */ -lexer.prototype.input = function() { - const ch = this._input[this.offset]; - if (!ch) return ""; - this.yytext += ch; - this.offset++; - if (ch === "\r" && this._input[this.offset] === "\n") { - this.yytext += "\n"; - this.offset++; - } - if (ch === "\n" || ch === "\r") { - this.yylloc.last_line = ++this.yylineno; - this.yyprevcol = this.yylloc.last_column; - this.yylloc.last_column = 0; - } else { - this.yylloc.last_column++; - } - return ch; -}; - -/** - * revert eating specified size - */ -lexer.prototype.unput = function(size) { - if (size === 1) { - // 1 char unput (most cases) - this.offset--; - if ( - this._input[this.offset] === "\n" && - this._input[this.offset - 1] === "\r" - ) { - this.offset--; - size++; - } - if ( - this._input[this.offset] === "\r" || - this._input[this.offset] === "\n" - ) { - this.yylloc.last_line--; - this.yylineno--; - this.yylloc.last_column = this.yyprevcol; - } else { - this.yylloc.last_column--; - } - this.yytext = this.yytext.substring(0, this.yytext.length - size); - } else if (size > 0) { - this.offset -= size; - if (size < this.yytext.length) { - this.yytext = this.yytext.substring(0, this.yytext.length - size); - // re-calculate position - this.yylloc.last_line = this.yylloc.first_line; - this.yylloc.last_column = this.yyprevcol = this.yylloc.first_column; - for (let i = 0; i < this.yytext.length; i++) { - let c = this.yytext[i]; - if (c === "\r") { - c = this.yytext[++i]; - this.yyprevcol = this.yylloc.last_column; - this.yylloc.last_line++; - this.yylloc.last_column = 0; - if (c !== "\n") { - if (c === "\r") { - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - } - } else if (c === "\n") { - this.yyprevcol = this.yylloc.last_column; - this.yylloc.last_line++; - this.yylloc.last_column = 0; - } else { - this.yylloc.last_column++; - } - } - this.yylineno = this.yylloc.last_line; - } else { - // reset full text - this.yytext = ""; - this.yylloc.last_line = this.yylineno = this.yylloc.first_line; - this.yylloc.last_column = this.yylloc.first_column; - } - } - - return this; -}; - -// check if the text matches -lexer.prototype.tryMatch = function(text) { - return text === this.ahead(text.length); -}; - -// check if the text matches -lexer.prototype.tryMatchCaseless = function(text) { - return text === this.ahead(text.length).toLowerCase(); -}; - -// look ahead -lexer.prototype.ahead = function(size) { - let text = this._input.substring(this.offset, this.offset + size); - if ( - text[text.length - 1] === "\r" && - this._input[this.offset + size + 1] === "\n" - ) { - text += "\n"; - } - return text; -}; - -// consume the specified size -lexer.prototype.consume = function(size) { - for (let i = 0; i < size; i++) { - const ch = this._input[this.offset]; - if (!ch) break; - this.yytext += ch; - this.offset++; - if (ch === "\r" && this._input[this.offset] === "\n") { - this.yytext += "\n"; - this.offset++; - i++; - } - if (ch === "\n" || ch === "\r") { - this.yylloc.last_line = ++this.yylineno; - this.yyprevcol = this.yylloc.last_column; - this.yylloc.last_column = 0; - } else { - this.yylloc.last_column++; - } - } - return this; -}; - -/** - * Gets the current state - */ -lexer.prototype.getState = function() { - return { - yytext: this.yytext, - offset: this.offset, - yylineno: this.yylineno, - yyprevcol: this.yyprevcol, - yylloc: { - first_offset: this.yylloc.first_offset, - first_line: this.yylloc.first_line, - first_column: this.yylloc.first_column, - last_line: this.yylloc.last_line, - last_column: this.yylloc.last_column - } - }; -}; - -/** - * Sets the current lexer state - */ -lexer.prototype.setState = function(state) { - this.yytext = state.yytext; - this.offset = state.offset; - this.yylineno = state.yylineno; - this.yyprevcol = state.yyprevcol; - this.yylloc = state.yylloc; - return this; -}; - -// prepend next token -lexer.prototype.appendToken = function(value, ahead) { - this.tokens.push([value, ahead]); - return this; -}; - -// return next match that has a token -lexer.prototype.lex = function() { - this.yylloc.prev_offset = this.offset; - this.yylloc.prev_line = this.yylloc.last_line; - this.yylloc.prev_column = this.yylloc.last_column; - let token = this.next() || this.lex(); - if (!this.all_tokens) { - while ( - token === this.tok.T_WHITESPACE || // ignore white space - (!this.comment_tokens && - (token === this.tok.T_COMMENT || // ignore single lines comments - token === this.tok.T_DOC_COMMENT)) || // ignore doc comments - // ignore open tags - token === this.tok.T_OPEN_TAG - ) { - token = this.next() || this.lex(); - } - if (token == this.tok.T_OPEN_TAG_WITH_ECHO) { - // https://github.com/php/php-src/blob/7ff186434e82ee7be7c59d0db9a976641cf7b09c/Zend/zend_compile.c#L1683 - // open tag with echo statement - return this.tok.T_ECHO; - } else if (token === this.tok.T_CLOSE_TAG) { - // https://github.com/php/php-src/blob/7ff186434e82ee7be7c59d0db9a976641cf7b09c/Zend/zend_compile.c#L1680 - return ";"; /* implicit ; */ - } - } - if (!this.yylloc.prev_offset) { - this.yylloc.prev_offset = this.yylloc.first_offset; - this.yylloc.prev_line = this.yylloc.first_line; - this.yylloc.prev_column = this.yylloc.first_column; - } - /*else if (this.yylloc.prev_offset === this.offset && this.offset !== this.size) { - throw new Error('Infinite loop @ ' + this.offset + ' / ' + this.size); - }*/ - return token; -}; - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -lexer.prototype.begin = function(condition) { - this.conditionStack.push(condition); - this.curCondition = condition; - this.stateCb = this["match" + condition]; - if (typeof this.stateCb !== "function") { - throw new Error('Undefined condition state "' + condition + '"'); - } - return this; -}; - -// pop the previously active lexer condition state off the condition stack -lexer.prototype.popState = function() { - const n = this.conditionStack.length - 1; - const condition = n > 0 ? this.conditionStack.pop() : this.conditionStack[0]; - this.curCondition = this.conditionStack[this.conditionStack.length - 1]; - this.stateCb = this["match" + this.curCondition]; - if (typeof this.stateCb !== "function") { - throw new Error('Undefined condition state "' + this.curCondition + '"'); - } - return condition; -}; - -// return next match in input -lexer.prototype.next = function() { - let token; - if (!this._input) { - this.done = true; - } - this.yylloc.first_offset = this.offset; - this.yylloc.first_line = this.yylloc.last_line; - this.yylloc.first_column = this.yylloc.last_column; - this.yytext = ""; - if (this.done) { - this.yylloc.prev_offset = this.yylloc.first_offset; - this.yylloc.prev_line = this.yylloc.first_line; - this.yylloc.prev_column = this.yylloc.first_column; - return this.EOF; - } - if (this.tokens.length > 0) { - token = this.tokens.shift(); - if (typeof token[1] === "object") { - this.setState(token[1]); - } else { - this.consume(token[1]); - } - token = token[0]; - } else { - token = this.stateCb.apply(this, []); - } - if (this.offset >= this.size && this.tokens.length === 0) { - this.done = true; - } - if (this.debug) { - let tName = token; - if (typeof tName === "number") { - tName = this.engine.tokens.values[tName]; - } else { - tName = '"' + tName + '"'; - } - const e = new Error( - tName + - "\tfrom " + - this.yylloc.first_line + - "," + - this.yylloc.first_column + - "\t - to " + - this.yylloc.last_line + - "," + - this.yylloc.last_column + - '\t"' + - this.yytext + - '"' - ); - // eslint-disable-next-line no-console - console.error(e.stack); - } - return token; -}; - -// extends the lexer with states -[ - require("./lexer/comments.js"), - require("./lexer/initial.js"), - require("./lexer/numbers.js"), - require("./lexer/property.js"), - require("./lexer/scripting.js"), - require("./lexer/strings.js"), - require("./lexer/tokens.js"), - require("./lexer/utils.js") -].forEach(function(ext) { - for (const k in ext) { - lexer.prototype[k] = ext[k]; - } -}); - -module.exports = lexer; diff --git a/src/lexer/comments.js b/src/lexer/comments.js deleted file mode 100644 index d38240562..000000000 --- a/src/lexer/comments.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * Reads a single line comment - */ - T_COMMENT: function() { - while (this.offset < this.size) { - const ch = this.input(); - if (ch === "\n" || ch === "\r") { - return this.tok.T_COMMENT; - } else if ( - ch === "?" && - !this.aspTagMode && - this._input[this.offset] === ">" - ) { - this.unput(1); - return this.tok.T_COMMENT; - } else if ( - ch === "%" && - this.aspTagMode && - this._input[this.offset] === ">" - ) { - this.unput(1); - return this.tok.T_COMMENT; - } - } - return this.tok.T_COMMENT; - }, - /** - * Behaviour : https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1927 - */ - T_DOC_COMMENT: function() { - let ch = this.input(); - let token = this.tok.T_COMMENT; - if (ch === "*") { - // started with '/*' , check is next is '*' - ch = this.input(); - if (this.is_WHITESPACE()) { - // check if next is WHITESPACE - token = this.tok.T_DOC_COMMENT; - } - if (ch === "/") { - return token; - } else { - this.unput(1); // reset - } - } - while (this.offset < this.size) { - ch = this.input(); - if (ch === "*" && this._input[this.offset] === "/") { - this.input(); - break; - } - } - return token; - } -}; diff --git a/src/lexer/initial.js b/src/lexer/initial.js deleted file mode 100644 index 03bb9d7d7..000000000 --- a/src/lexer/initial.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - nextINITIAL: function() { - if ( - this.conditionStack.length > 1 && - this.conditionStack[this.conditionStack.length - 1] === "INITIAL" - ) { - // Return to HEREDOC/ST_DOUBLE_QUOTES mode - this.popState(); - } else { - this.begin("ST_IN_SCRIPTING"); - } - return this; - }, - matchINITIAL: function() { - while (this.offset < this.size) { - let ch = this.input(); - if (ch == "<") { - ch = this.ahead(1); - if (ch == "?") { - if (this.tryMatch("?=")) { - this.unput(1) - .appendToken(this.tok.T_OPEN_TAG_WITH_ECHO, 3) - .nextINITIAL(); - break; - } else if (this.tryMatchCaseless("?php")) { - ch = this._input[this.offset + 4]; - if (ch === " " || ch === "\t" || ch === "\n" || ch === "\r") { - this.unput(1) - .appendToken(this.tok.T_OPEN_TAG, 6) - .nextINITIAL(); - break; - } - } - if (this.short_tags) { - this.unput(1) - .appendToken(this.tok.T_OPEN_TAG, 2) - .nextINITIAL(); - break; - } - } else if (this.asp_tags && ch == "%") { - if (this.tryMatch("%=")) { - this.aspTagMode = true; - this.unput(1) - .appendToken(this.tok.T_OPEN_TAG_WITH_ECHO, 3) - .nextINITIAL(); - break; - } else { - this.aspTagMode = true; - this.unput(1) - .appendToken(this.tok.T_OPEN_TAG, 2) - .nextINITIAL(); - break; - } - } - } - } - if (this.yytext.length > 0) { - return this.tok.T_INLINE_HTML; - } else { - return false; - } - } -}; diff --git a/src/lexer/numbers.js b/src/lexer/numbers.js deleted file mode 100644 index e2b2a02a2..000000000 --- a/src/lexer/numbers.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -/* istanbul ignore else */ -let MAX_LENGTH_OF_LONG = 10; -let long_min_digits = "2147483648"; -if (process.arch == "x64") { - MAX_LENGTH_OF_LONG = 19; - long_min_digits = "9223372036854775808"; -} - -module.exports = { - consume_NUM: function() { - let ch = this.yytext[0]; - let hasPoint = this.yytext[0] === "."; - if (ch === "0") { - ch = this.input(); - // check if hexa - if (ch === "x" || ch === "X") { - ch = this.input(); - if (this.is_HEX()) { - return this.consume_HNUM(); - } else { - this.unput(ch ? 2 : 1); - } - } else if (ch === "b" || ch === "B") { - ch = this.input(); - if (ch === "0" || ch === "1") { - return this.consume_BNUM(); - } else { - this.unput(ch ? 2 : 1); - } - } else if (!this.is_NUM()) { - if (ch) this.unput(1); - } - } - - while (this.offset < this.size) { - ch = this.input(); - if (!this.is_NUM()) { - if (ch === "." && !hasPoint) { - hasPoint = true; - } else if (ch === "e" || ch === "E") { - ch = this.input(); - if (ch === "+" || ch === "-") { - ch = this.input(); - if (this.is_NUM()) { - this.consume_LNUM(); - return this.tok.T_DNUMBER; - } else { - this.unput(ch ? 3 : 2); - break; - } - } else if (this.is_NUM()) { - this.consume_LNUM(); - return this.tok.T_DNUMBER; - } else { - this.unput(ch ? 2 : 1); - break; - } - } else { - if (ch) this.unput(1); - break; - } - } - } - if (hasPoint) { - return this.tok.T_DNUMBER; - } else if (this.yytext.length < MAX_LENGTH_OF_LONG - 1) { - return this.tok.T_LNUMBER; - } else { - if ( - this.yytext.length < MAX_LENGTH_OF_LONG || - (this.yytext.length == MAX_LENGTH_OF_LONG && - this.yytext < long_min_digits) - ) { - return this.tok.T_LNUMBER; - } - return this.tok.T_DNUMBER; - } - }, - // read hexa - consume_HNUM: function() { - while (this.offset < this.size) { - const ch = this.input(); - if (!this.is_HEX()) { - if (ch) this.unput(1); - break; - } - } - return this.tok.T_LNUMBER; - }, - // read a generic number - consume_LNUM: function() { - while (this.offset < this.size) { - const ch = this.input(); - if (!this.is_NUM()) { - if (ch) this.unput(1); - break; - } - } - return this.tok.T_LNUMBER; - }, - // read binary - consume_BNUM: function() { - let ch; - while (this.offset < this.size) { - ch = this.input(); - if (ch !== "0" && ch !== "1") { - if (ch) this.unput(1); - break; - } - } - return this.tok.T_LNUMBER; - } -}; diff --git a/src/lexer/property.js b/src/lexer/property.js deleted file mode 100644 index 6d6d5b1b2..000000000 --- a/src/lexer/property.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - matchST_LOOKING_FOR_PROPERTY: function() { - let ch = this.input(); - if (ch === "-") { - ch = this.input(); - if (ch === ">") { - // https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1296 - return this.tok.T_OBJECT_OPERATOR; - } - if (ch) this.unput(1); - } else if (this.is_WHITESPACE()) { - return this.tok.T_WHITESPACE; - } else if (this.is_LABEL_START()) { - // https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1300 - this.consume_LABEL(); - this.popState(); - return this.tok.T_STRING; - } - // https://github.com/php/php-src/blob/master/Zend/zend_language_scanner.l#L1306 - this.popState(); - if (ch) this.unput(1); - return false; - }, - matchST_LOOKING_FOR_VARNAME: function() { - let ch = this.input(); - - // SHIFT STATE - this.popState(); - this.begin("ST_IN_SCRIPTING"); - - if (this.is_LABEL_START()) { - this.consume_LABEL(); - ch = this.input(); - if (ch === "[" || ch === "}") { - this.unput(1); - return this.tok.T_STRING_VARNAME; - } else { - // any char (that's started with a label sequence) - this.unput(this.yytext.length); - } - } else { - // any char (thats not a label start sequence) - if (ch) this.unput(1); - } - // stops looking for a varname and starts the scripting mode - return false; - }, - matchST_VAR_OFFSET: function() { - const ch = this.input(); - if (this.is_NUM()) { - this.consume_NUM(); - return this.tok.T_NUM_STRING; - } else if (ch === "]") { - this.popState(); - return "]"; - } else if (ch === "$") { - this.input(); - if (this.is_LABEL_START()) { - this.consume_LABEL(); - return this.tok.T_VARIABLE; - } else { - throw new Error("Unexpected terminal"); - } - } else if (this.is_LABEL_START()) { - this.consume_LABEL(); - return this.tok.T_STRING; - } else if ( - this.is_WHITESPACE() || - ch === "\\" || - ch === "'" || - ch === "#" - ) { - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else if ( - ch === "[" || - ch === "{" || - ch === "}" || - ch === '"' || - ch === "`" || - this.is_TOKEN() - ) { - return ch; - } else { - throw new Error("Unexpected terminal"); - } - } -}; diff --git a/src/lexer/scripting.js b/src/lexer/scripting.js deleted file mode 100644 index a577290b3..000000000 --- a/src/lexer/scripting.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - matchST_IN_SCRIPTING: function() { - let ch = this.input(); - switch (ch) { - case " ": - case "\t": - case "\n": - case "\r": - case "\r\n": - return this.T_WHITESPACE(); - case "#": - return this.T_COMMENT(); - case "/": - if (this._input[this.offset] === "/") { - return this.T_COMMENT(); - } else if (this._input[this.offset] === "*") { - this.input(); - return this.T_DOC_COMMENT(); - } - return this.consume_TOKEN(); - case "'": - return this.T_CONSTANT_ENCAPSED_STRING(); - case '"': - return this.ST_DOUBLE_QUOTES(); - case "`": - this.begin("ST_BACKQUOTE"); - return "`"; - case "?": - if (!this.aspTagMode && this.tryMatch(">")) { - this.input(); - const nextCH = this._input[this.offset]; - if (nextCH === "\n" || nextCH === "\r") this.input(); - if (this.conditionStack.length > 1) { - this.begin("INITIAL"); - } - return this.tok.T_CLOSE_TAG; - } - return this.consume_TOKEN(); - case "%": - if (this.aspTagMode && this._input[this.offset] === ">") { - this.input(); // consume the '>' - ch = this._input[this.offset]; // read next - if (ch === "\n" || ch === "\r") { - this.input(); // consume the newline - } - this.aspTagMode = false; - if (this.conditionStack.length > 1) { - this.begin("INITIAL"); - } - return this.tok.T_CLOSE_TAG; - } - return this.consume_TOKEN(); - case "{": - this.begin("ST_IN_SCRIPTING"); - return "{"; - case "}": - if (this.conditionStack.length > 2) { - // Return to HEREDOC/ST_DOUBLE_QUOTES mode - this.popState(); - } - return "}"; - default: - if (ch === ".") { - ch = this.input(); - if (this.is_NUM()) { - return this.consume_NUM(); - } else { - if (ch) this.unput(1); - } - } - if (this.is_NUM()) { - return this.consume_NUM(); - } else if (this.is_LABEL_START()) { - return this.consume_LABEL().T_STRING(); - } else if (this.is_TOKEN()) { - return this.consume_TOKEN(); - } - } - throw new Error( - 'Bad terminal sequence "' + - ch + - '" at line ' + - this.yylineno + - " (offset " + - this.offset + - ")" - ); - }, - - T_WHITESPACE: function() { - while (this.offset < this.size) { - const ch = this.input(); - if (ch === " " || ch === "\t" || ch === "\n" || ch === "\r") { - continue; - } - if (ch) this.unput(1); - break; - } - return this.tok.T_WHITESPACE; - } -}; diff --git a/src/lexer/strings.js b/src/lexer/strings.js deleted file mode 100644 index d2d0100bd..000000000 --- a/src/lexer/strings.js +++ /dev/null @@ -1,417 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - T_CONSTANT_ENCAPSED_STRING: function() { - let ch; - while (this.offset < this.size) { - ch = this.input(); - if (ch == "\\") { - this.input(); - } else if (ch == "'") { - break; - } - } - return this.tok.T_CONSTANT_ENCAPSED_STRING; - }, - // check if matching a HEREDOC state - is_HEREDOC: function() { - const revert = this.offset; - if ( - this._input[this.offset - 1] === "<" && - this._input[this.offset] === "<" && - this._input[this.offset + 1] === "<" - ) { - this.offset += 3; - - // optional tabs / spaces - if (this.is_TABSPACE()) { - while (this.offset < this.size) { - this.offset++; - if (!this.is_TABSPACE()) { - break; - } - } - } - - // optional quotes - let tChar = this._input[this.offset - 1]; - if (tChar === "'" || tChar === '"') { - this.offset++; - } else { - tChar = null; - } - - // required label - if (this.is_LABEL_START()) { - let yyoffset = this.offset - 1; - while (this.offset < this.size) { - this.offset++; - if (!this.is_LABEL()) { - break; - } - } - const yylabel = this._input.substring(yyoffset, this.offset - 1); - if (!tChar || tChar === this._input[this.offset - 1]) { - // required ending quote - if (tChar) this.offset++; - // require newline - if ( - this._input[this.offset - 1] === "\r" || - this._input[this.offset - 1] === "\n" - ) { - // go go go - this.heredoc_label = yylabel; - yyoffset = this.offset - revert; - this.offset = revert; - this.consume(yyoffset); - if (tChar === "'") { - this.begin("ST_NOWDOC"); - } else { - this.begin("ST_HEREDOC"); - } - return this.tok.T_START_HEREDOC; - } - } - } - } - this.offset = revert; - return false; - }, - ST_DOUBLE_QUOTES: function() { - let ch; - while (this.offset < this.size) { - ch = this.input(); - if (ch == "\\") { - this.input(); - } else if (ch == '"') { - break; - } else if (ch == "$") { - ch = this.input(); - if (ch == "{" || this.is_LABEL_START()) { - this.unput(2); - break; - } - if (ch) this.unput(1); - } else if (ch == "{") { - ch = this.input(); - if (ch == "$") { - this.unput(2); - break; - } - if (ch) this.unput(1); - } - } - if (ch == '"') { - return this.tok.T_CONSTANT_ENCAPSED_STRING; - } else { - let prefix = 1; - if (this.yytext[0] === "b" || this.yytext[0] === "B") { - prefix = 2; - } - if (this.yytext.length > 2) { - this.appendToken( - this.tok.T_ENCAPSED_AND_WHITESPACE, - this.yytext.length - prefix - ); - } - this.unput(this.yytext.length - prefix); - this.begin("ST_DOUBLE_QUOTES"); - return this.yytext; - } - }, - - // check if its a DOC end sequence - isDOC_MATCH: function() { - // @fixme : check if out of text limits - if ( - this._input.substring( - this.offset - 1, - this.offset - 1 + this.heredoc_label.length - ) === this.heredoc_label - ) { - const ch = this._input[this.offset - 1 + this.heredoc_label.length]; - if (ch === "\n" || ch === "\r" || ch === ";") { - return true; - } - } - return false; - }, - - matchST_NOWDOC: function() { - /** edge case : empty now doc **/ - if (this.isDOC_MATCH()) { - // @fixme : never reached (may be caused by quotes) - this.consume(this.heredoc_label.length); - this.popState(); - return this.tok.T_END_HEREDOC; - } - /** SCANNING CONTENTS **/ - let ch = this._input[this.offset - 1]; - while (this.offset < this.size) { - if (ch === "\n" || ch === "\r") { - ch = this.input(); - if (this.isDOC_MATCH()) { - this.unput(1).popState(); - this.appendToken(this.tok.T_END_HEREDOC, this.heredoc_label.length); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } - } else { - ch = this.input(); - } - } - // too bad ! reached end of document (will get a parse error) - return this.tok.T_ENCAPSED_AND_WHITESPACE; - }, - - matchST_HEREDOC: function() { - /** edge case : empty here doc **/ - let ch = this.input(); - if (this.isDOC_MATCH()) { - this.consume(this.heredoc_label.length - 1); - this.popState(); - return this.tok.T_END_HEREDOC; - } - /** SCANNING CONTENTS **/ - while (this.offset < this.size) { - if (ch === "\\") { - ch = this.input(); // ignore next - if (ch !== "\n" && ch !== "\r") { - ch = this.input(); - } - } - - if (ch === "\n" || ch === "\r") { - ch = this.input(); - if (this.isDOC_MATCH()) { - this.unput(1).popState(); - this.appendToken(this.tok.T_END_HEREDOC, this.heredoc_label.length); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } - } else if (ch === "$") { - ch = this.input(); - if (ch === "{") { - // start of ${ - this.begin("ST_LOOKING_FOR_VARNAME"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES, 2); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } - } else if (this.is_LABEL_START()) { - // start of $var... - const yyoffset = this.offset; - const next = this.consume_VARIABLE(); - if (this.yytext.length > this.offset - yyoffset + 2) { - this.appendToken(next, this.offset - yyoffset + 2); - this.unput(this.offset - yyoffset + 2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return next; - } - //console.log(this.yytext); - } - } else if (ch === "{") { - ch = this.input(); - if (ch === "$") { - // start of {$... - this.begin("ST_IN_SCRIPTING"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_CURLY_OPEN, 1); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - this.unput(1); - return this.tok.T_CURLY_OPEN; - } - } - } else { - ch = this.input(); - } - } - - // too bad ! reached end of document (will get a parse error) - return this.tok.T_ENCAPSED_AND_WHITESPACE; - }, - - consume_VARIABLE: function() { - this.consume_LABEL(); - const ch = this.input(); - if (ch == "[") { - this.unput(1); - this.begin("ST_VAR_OFFSET"); - return this.tok.T_VARIABLE; - } else if (ch === "-") { - if (this.input() === ">") { - this.input(); - if (this.is_LABEL_START()) { - this.begin("ST_LOOKING_FOR_PROPERTY"); - } - this.unput(3); - return this.tok.T_VARIABLE; - } else { - this.unput(2); - } - } else { - if (ch) this.unput(1); - } - return this.tok.T_VARIABLE; - }, - // HANDLES BACKQUOTES - matchST_BACKQUOTE: function() { - let ch = this.input(); - if (ch === "$") { - ch = this.input(); - if (ch === "{") { - this.begin("ST_LOOKING_FOR_VARNAME"); - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } else if (this.is_LABEL_START()) { - const tok = this.consume_VARIABLE(); - return tok; - } - } else if (ch === "{") { - if (this._input[this.offset] === "$") { - this.begin("ST_IN_SCRIPTING"); - return this.tok.T_CURLY_OPEN; - } - } else if (ch === "`") { - this.popState(); - return "`"; - } - - // any char - while (this.offset < this.size) { - if (ch === "\\") { - this.input(); - } else if (ch === "`") { - this.unput(1); - this.popState(); - this.appendToken("`", 1); - break; - } else if (ch === "$") { - ch = this.input(); - if (ch === "{") { - this.begin("ST_LOOKING_FOR_VARNAME"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES, 2); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } - } else if (this.is_LABEL_START()) { - // start of $var... - const yyoffset = this.offset; - const next = this.consume_VARIABLE(); - if (this.yytext.length > this.offset - yyoffset + 2) { - this.appendToken(next, this.offset - yyoffset + 2); - this.unput(this.offset - yyoffset + 2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return next; - } - } - continue; - } else if (ch === "{") { - ch = this.input(); - if (ch === "$") { - // start of {$... - this.begin("ST_IN_SCRIPTING"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_CURLY_OPEN, 1); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - this.unput(1); - return this.tok.T_CURLY_OPEN; - } - } - continue; - } - ch = this.input(); - } - return this.tok.T_ENCAPSED_AND_WHITESPACE; - }, - - matchST_DOUBLE_QUOTES: function() { - let ch = this.input(); - if (ch === "$") { - ch = this.input(); - if (ch === "{") { - this.begin("ST_LOOKING_FOR_VARNAME"); - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } else if (this.is_LABEL_START()) { - const tok = this.consume_VARIABLE(); - return tok; - } - } else if (ch === "{") { - if (this._input[this.offset] === "$") { - this.begin("ST_IN_SCRIPTING"); - return this.tok.T_CURLY_OPEN; - } - } else if (ch === '"') { - this.popState(); - return '"'; - } - - // any char - while (this.offset < this.size) { - if (ch === "\\") { - this.input(); - } else if (ch === '"') { - this.unput(1); - this.popState(); - this.appendToken('"', 1); - break; - } else if (ch === "$") { - ch = this.input(); - if (ch === "{") { - this.begin("ST_LOOKING_FOR_VARNAME"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES, 2); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return this.tok.T_DOLLAR_OPEN_CURLY_BRACES; - } - } else if (this.is_LABEL_START()) { - // start of $var... - const yyoffset = this.offset; - const next = this.consume_VARIABLE(); - if (this.yytext.length > this.offset - yyoffset + 2) { - this.appendToken(next, this.offset - yyoffset + 2); - this.unput(this.offset - yyoffset + 2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - return next; - } - } - if (ch) this.unput(1); - } else if (ch === "{") { - ch = this.input(); - if (ch === "$") { - // start of {$... - this.begin("ST_IN_SCRIPTING"); - if (this.yytext.length > 2) { - this.appendToken(this.tok.T_CURLY_OPEN, 1); - this.unput(2); - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } else { - // @fixme : yytext = '"{$' (this.yytext.length > 3) - this.unput(1); - return this.tok.T_CURLY_OPEN; - } - } - if (ch) this.unput(1); - } - ch = this.input(); - } - return this.tok.T_ENCAPSED_AND_WHITESPACE; - } -}; diff --git a/src/lexer/tokens.js b/src/lexer/tokens.js deleted file mode 100644 index fbec8db37..000000000 --- a/src/lexer/tokens.js +++ /dev/null @@ -1,271 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - T_STRING: function() { - const token = this.yytext.toLowerCase(); - let id = this.keywords[token]; - if (typeof id !== "number") { - if (token === "yield") { - if (this.php7 && this.tryMatch(" from")) { - this.consume(5); - id = this.tok.T_YIELD_FROM; - } else { - id = this.tok.T_YIELD; - } - } else { - id = this.tok.T_STRING; - if (token === "b" || token === "B") { - const ch = this.input(1); - if (ch === '"') { - return this.ST_DOUBLE_QUOTES(); - } else if (ch === "'") { - return this.T_CONSTANT_ENCAPSED_STRING(); - } else if (ch) { - this.unput(1); - } - } - } - } - return id; - }, - // reads a custom token - consume_TOKEN: function() { - const ch = this._input[this.offset - 1]; - const fn = this.tokenTerminals[ch]; - if (fn) { - return fn.apply(this, []); - } else { - return this.yytext; - } - }, - // list of special char tokens - tokenTerminals: { - $: function() { - this.offset++; - if (this.is_LABEL_START()) { - this.offset--; - this.consume_LABEL(); - return this.tok.T_VARIABLE; - } else { - this.offset--; - return "$"; - } - }, - "-": function() { - const nchar = this._input[this.offset]; - if (nchar === ">") { - this.begin("ST_LOOKING_FOR_PROPERTY").input(); - return this.tok.T_OBJECT_OPERATOR; - } else if (nchar === "-") { - this.input(); - return this.tok.T_DEC; - } else if (nchar === "=") { - this.input(); - return this.tok.T_MINUS_EQUAL; - } - return "-"; - }, - "\\": function() { - return this.tok.T_NS_SEPARATOR; - }, - "/": function() { - if (this._input[this.offset] === "=") { - this.input(); - return this.tok.T_DIV_EQUAL; - } - return "/"; - }, - ":": function() { - if (this._input[this.offset] === ":") { - this.input(); - return this.tok.T_DOUBLE_COLON; - } else { - return ":"; - } - }, - "(": function() { - const initial = this.offset; - this.input(); - if (this.is_TABSPACE()) { - this.consume_TABSPACE().input(); - } - if (this.is_LABEL_START()) { - const yylen = this.yytext.length; - this.consume_LABEL(); - const castToken = this.yytext.substring(yylen - 1).toLowerCase(); - const castId = this.castKeywords[castToken]; - if (typeof castId === "number") { - this.input(); - if (this.is_TABSPACE()) { - this.consume_TABSPACE().input(); - } - if (this._input[this.offset - 1] === ")") { - return castId; - } - } - } - // revert the check - this.unput(this.offset - initial); - return "("; - }, - "=": function() { - const nchar = this._input[this.offset]; - if (nchar === ">") { - this.input(); - return this.tok.T_DOUBLE_ARROW; - } else if (nchar === "=") { - if (this._input[this.offset + 1] === "=") { - this.consume(2); - return this.tok.T_IS_IDENTICAL; - } else { - this.input(); - return this.tok.T_IS_EQUAL; - } - } - return "="; - }, - "+": function() { - const nchar = this._input[this.offset]; - if (nchar === "+") { - this.input(); - return this.tok.T_INC; - } else if (nchar === "=") { - this.input(); - return this.tok.T_PLUS_EQUAL; - } - return "+"; - }, - "!": function() { - if (this._input[this.offset] === "=") { - if (this._input[this.offset + 1] === "=") { - this.consume(2); - return this.tok.T_IS_NOT_IDENTICAL; - } else { - this.input(); - return this.tok.T_IS_NOT_EQUAL; - } - } - return "!"; - }, - "?": function() { - if (this.php7 && this._input[this.offset] === "?") { - this.input(); - return this.tok.T_COALESCE; - } - return "?"; - }, - "<": function() { - let nchar = this._input[this.offset]; - if (nchar === "<") { - nchar = this._input[this.offset + 1]; - if (nchar === "=") { - this.consume(2); - return this.tok.T_SL_EQUAL; - } else if (nchar === "<") { - if (this.is_HEREDOC()) { - return this.tok.T_START_HEREDOC; - } - } - this.input(); - return this.tok.T_SL; - } else if (nchar === "=") { - this.input(); - if (this.php7 && this._input[this.offset] === ">") { - this.input(); - return this.tok.T_SPACESHIP; - } else { - return this.tok.T_IS_SMALLER_OR_EQUAL; - } - } else if (nchar === ">") { - this.input(); - return this.tok.T_IS_NOT_EQUAL; - } - return "<"; - }, - ">": function() { - let nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_IS_GREATER_OR_EQUAL; - } else if (nchar === ">") { - nchar = this._input[this.offset + 1]; - if (nchar === "=") { - this.consume(2); - return this.tok.T_SR_EQUAL; - } else { - this.input(); - return this.tok.T_SR; - } - } - return ">"; - }, - "*": function() { - const nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_MUL_EQUAL; - } else if (nchar === "*") { - this.input(); - if (this._input[this.offset] === "=") { - this.input(); - return this.tok.T_POW_EQUAL; - } else { - return this.tok.T_POW; - } - } - return "*"; - }, - ".": function() { - const nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_CONCAT_EQUAL; - } else if (nchar === "." && this._input[this.offset + 1] === ".") { - this.consume(2); - return this.tok.T_ELLIPSIS; - } - return "."; - }, - "%": function() { - if (this._input[this.offset] === "=") { - this.input(); - return this.tok.T_MOD_EQUAL; - } - return "%"; - }, - "&": function() { - const nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_AND_EQUAL; - } else if (nchar === "&") { - this.input(); - return this.tok.T_BOOLEAN_AND; - } - return "&"; - }, - "|": function() { - const nchar = this._input[this.offset]; - if (nchar === "=") { - this.input(); - return this.tok.T_OR_EQUAL; - } else if (nchar === "|") { - this.input(); - return this.tok.T_BOOLEAN_OR; - } - return "|"; - }, - "^": function() { - if (this._input[this.offset] === "=") { - this.input(); - return this.tok.T_XOR_EQUAL; - } - return "^"; - } - } -}; diff --git a/src/lexer/utils.js b/src/lexer/utils.js deleted file mode 100644 index 190d0f626..000000000 --- a/src/lexer/utils.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const tokens = ";:,.\\[]()|^&+-/*=%!~$<>?@"; - -module.exports = { - // check if the char can be a numeric - is_NUM: function() { - const ch = this._input.charCodeAt(this.offset - 1); - return ch > 47 && ch < 58; - }, - - // check if current char can be a label - is_LABEL: function() { - const ch = this._input.charCodeAt(this.offset - 1); - return ( - (ch > 96 && ch < 123) || - (ch > 64 && ch < 91) || - ch === 95 || - (ch > 47 && ch < 58) || - ch > 126 - ); - }, - - // check if current char can be a label - is_LABEL_START: function() { - const ch = this._input.charCodeAt(this.offset - 1); - return ( - (ch > 96 && ch < 123) || (ch > 64 && ch < 91) || ch === 95 || ch > 126 - ); - }, - - // reads each char of the label - consume_LABEL: function() { - while (this.offset < this.size) { - const ch = this.input(); - if (!this.is_LABEL()) { - if (ch) this.unput(1); - break; - } - } - return this; - }, - - // check if current char is a token char - is_TOKEN: function() { - const ch = this._input[this.offset - 1]; - return tokens.indexOf(ch) !== -1; - }, - // check if current char is a whitespace - is_WHITESPACE: function() { - const ch = this._input[this.offset - 1]; - return ch === " " || ch === "\t" || ch === "\n" || ch === "\r"; - }, - // check if current char is a whitespace (without newlines) - is_TABSPACE: function() { - const ch = this._input[this.offset - 1]; - return ch === " " || ch === "\t"; - }, - // consume all whitespaces (excluding newlines) - consume_TABSPACE: function() { - while (this.offset < this.size) { - const ch = this.input(); - if (!this.is_TABSPACE()) { - if (ch) this.unput(1); - break; - } - } - return this; - }, - // check if current char can be a hexadecimal number - is_HEX: function() { - const ch = this._input.charCodeAt(this.offset - 1); - return ( - (ch > 47 && ch < 58) || (ch > 64 && ch < 71) || (ch > 96 && ch < 103) - ); - } -}; diff --git a/src/parser.js b/src/parser.js deleted file mode 100644 index ea9ff2380..000000000 --- a/src/parser.js +++ /dev/null @@ -1,565 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -/** - * @private - */ -function isNumber(n) { - return n != "." && n != "," && !isNaN(parseFloat(n)) && isFinite(n); -} - -/** - * The PHP Parser class that build the AST tree from the lexer - * - * @class - * @tutorial Parser - * @property {Lexer} lexer - current lexer instance - * @property {AST} ast - the AST factory instance - * @property {Integer|String} token - current token - * @property {Boolean} extractDoc - should extract documentation as AST node - * @property {Boolean} extractTokens - should extract each token - * @property {Boolean} suppressErrors - should ignore parsing errors and continue - * @property {Boolean} debug - should output debug informations - */ -const parser = function(lexer, ast) { - this.lexer = lexer; - this.ast = ast; - this.tok = lexer.tok; - this.EOF = lexer.EOF; - this.token = null; - this.prev = null; - this.debug = false; - this.php7 = true; - this.extractDoc = false; - this.extractTokens = false; - this.suppressErrors = false; - const mapIt = function(item) { - return [item, null]; - }; - this.entries = { - IDENTIFIER: new Map( - [ - this.tok.T_ABSTRACT, - this.tok.T_ARRAY, - this.tok.T_AS, - this.tok.T_BREAK, - this.tok.T_CALLABLE, - this.tok.T_CASE, - this.tok.T_CATCH, - this.tok.T_CLASS, - this.tok.T_CLASS_C, - this.tok.T_CLONE, - this.tok.T_CONST, - this.tok.T_CONTINUE, - this.tok.T_DECLARE, - this.tok.T_DEFAULT, - this.tok.T_DIR, - this.tok.T_DO, - this.tok.T_ECHO, - this.tok.T_ELSE, - this.tok.T_ELSEIF, - this.tok.T_EMPTY, - this.tok.T_ENDDECLARE, - this.tok.T_ENDFOR, - this.tok.T_ENDFOREACH, - this.tok.T_ENDIF, - this.tok.T_ENDSWITCH, - this.tok.T_ENDWHILE, - this.tok.T_EVAL, - this.tok.T_EXIT, - this.tok.T_EXTENDS, - this.tok.T_FILE, - this.tok.T_FINAL, - this.tok.T_FINALLY, - this.tok.T_FUNC_C, - this.tok.T_FOR, - this.tok.T_FOREACH, - this.tok.T_FUNCTION, - this.tok.T_GLOBAL, - this.tok.T_GOTO, - this.tok.T_IF, - this.tok.T_IMPLEMENTS, - this.tok.T_INCLUDE, - this.tok.T_INCLUDE_ONCE, - this.tok.T_INSTANCEOF, - this.tok.T_INSTEADOF, - this.tok.T_INTERFACE, - this.tok.T_ISSET, - this.tok.T_LINE, - this.tok.T_LIST, - this.tok.T_LOGICAL_AND, - this.tok.T_LOGICAL_OR, - this.tok.T_LOGICAL_XOR, - this.tok.T_METHOD_C, - this.tok.T_NAMESPACE, - this.tok.T_NEW, - this.tok.T_NS_C, - this.tok.T_PRINT, - this.tok.T_PRIVATE, - this.tok.T_PROTECTED, - this.tok.T_PUBLIC, - this.tok.T_REQUIRE, - this.tok.T_REQUIRE_ONCE, - this.tok.T_RETURN, - this.tok.T_STATIC, - this.tok.T_SWITCH, - this.tok.T_THROW, - this.tok.T_TRAIT, - this.tok.T_TRY, - this.tok.T_UNSET, - this.tok.T_USE, - this.tok.T_VAR, - this.tok.T_WHILE, - this.tok.T_YIELD - ].map(mapIt) - ), - VARIABLE: new Map( - [ - this.tok.T_VARIABLE, - "$", - "&", - this.tok.T_NS_SEPARATOR, - this.tok.T_STRING, - this.tok.T_NAMESPACE, - this.tok.T_STATIC - ].map(mapIt) - ), - SCALAR: new Map( - [ - this.tok.T_CONSTANT_ENCAPSED_STRING, - this.tok.T_START_HEREDOC, - this.tok.T_LNUMBER, - this.tok.T_DNUMBER, - this.tok.T_ARRAY, - "[", - this.tok.T_CLASS_C, - this.tok.T_TRAIT_C, - this.tok.T_FUNC_C, - this.tok.T_METHOD_C, - this.tok.T_LINE, - this.tok.T_FILE, - this.tok.T_DIR, - this.tok.T_NS_C, - '"', - 'b"', - 'B"', - "-", - this.tok.T_NS_SEPARATOR - ].map(mapIt) - ), - T_MAGIC_CONST: new Map( - [ - this.tok.T_CLASS_C, - this.tok.T_TRAIT_C, - this.tok.T_FUNC_C, - this.tok.T_METHOD_C, - this.tok.T_LINE, - this.tok.T_FILE, - this.tok.T_DIR, - this.tok.T_NS_C - ].map(mapIt) - ), - T_MEMBER_FLAGS: new Map( - [ - this.tok.T_PUBLIC, - this.tok.T_PRIVATE, - this.tok.T_PROTECTED, - this.tok.T_STATIC, - this.tok.T_ABSTRACT, - this.tok.T_FINAL - ].map(mapIt) - ), - EOS: new Map([";", this.EOF, this.tok.T_INLINE_HTML].map(mapIt)), - EXPR: new Map( - [ - "@", - "-", - "+", - "!", - "~", - "(", - "`", - this.tok.T_LIST, - this.tok.T_CLONE, - this.tok.T_INC, - this.tok.T_DEC, - this.tok.T_NEW, - this.tok.T_ISSET, - this.tok.T_EMPTY, - this.tok.T_INCLUDE, - this.tok.T_INCLUDE_ONCE, - this.tok.T_REQUIRE, - this.tok.T_REQUIRE_ONCE, - this.tok.T_EVAL, - this.tok.T_INT_CAST, - this.tok.T_DOUBLE_CAST, - this.tok.T_STRING_CAST, - this.tok.T_ARRAY_CAST, - this.tok.T_OBJECT_CAST, - this.tok.T_BOOL_CAST, - this.tok.T_UNSET_CAST, - this.tok.T_EXIT, - this.tok.T_PRINT, - this.tok.T_YIELD, - this.tok.T_STATIC, - this.tok.T_FUNCTION, - // using VARIABLES : - this.tok.T_VARIABLE, - "$", - this.tok.T_NS_SEPARATOR, - this.tok.T_STRING, - // using SCALAR : - this.tok.T_STRING, // @see variable.js line 45 > conflict with variable = shift/reduce :) - this.tok.T_CONSTANT_ENCAPSED_STRING, - this.tok.T_START_HEREDOC, - this.tok.T_LNUMBER, - this.tok.T_DNUMBER, - this.tok.T_ARRAY, - "[", - this.tok.T_CLASS_C, - this.tok.T_TRAIT_C, - this.tok.T_FUNC_C, - this.tok.T_METHOD_C, - this.tok.T_LINE, - this.tok.T_FILE, - this.tok.T_DIR, - this.tok.T_NS_C - ].map(mapIt) - ) - }; -}; - -/** - * helper : gets a token name - */ -parser.prototype.getTokenName = function(token) { - if (!isNumber(token)) { - return "'" + token + "'"; - } else { - if (token == this.EOF) return "the end of file (EOF)"; - return this.lexer.engine.tokens.values[token]; - } -}; - -/** - * main entry point : converts a source code to AST - */ -parser.prototype.parse = function(code, filename) { - this._errors = []; - this.filename = filename || "eval"; - this.currentNamespace = [""]; - if (this.extractDoc) { - this._docs = []; - } else { - this._docs = null; - } - if (this.extractTokens) { - this._tokens = []; - } else { - this._tokens = null; - } - this._docIndex = 0; - this.lexer.setInput(code); - this.lexer.all_tokens = this.extractTokens; - this.lexer.comment_tokens = this.extractDoc; - this.length = this.lexer._input.length; - this.innerList = false; - this.innerListForm = false; - const program = this.ast.prepare("program", null, this); - let childs = []; - this.next(); - while (this.token != this.EOF) { - const node = this.read_start(); - if (node !== null && node !== undefined) { - if (Array.isArray(node)) { - childs = childs.concat(node); - } else { - childs.push(node); - } - } - } - return program(childs, this._errors, this._docs, this._tokens); -}; - -/** - * Raise an error - */ -parser.prototype.raiseError = function(message, msgExpect, expect, token) { - message += " on line " + this.lexer.yylloc.first_line; - if (!this.suppressErrors) { - const err = new SyntaxError( - message, - this.filename, - this.lexer.yylloc.first_line - ); - err.lineNumber = this.lexer.yylloc.first_line; - err.fileName = this.filename; - err.columnNumber = this.lexer.yylloc.first_column; - throw err; - } - // Error node : - const node = this.ast.prepare("error", null, this)( - message, - token, - this.lexer.yylloc.first_line, - expect - ); - this._errors.push(node); - return node; -}; - -/** - * handling errors - */ -parser.prototype.error = function(expect) { - let msg = "Parse Error : syntax error"; - let token = this.getTokenName(this.token); - let msgExpect = ""; - - if (this.token !== this.EOF) { - if (isNumber(this.token)) { - let symbol = this.text(); - if (symbol.length > 10) { - symbol = symbol.substring(0, 7) + "..."; - } - token = "'" + symbol + "' (" + token + ")"; - } - msg += ", unexpected " + token; - } - if (expect && !Array.isArray(expect)) { - if (isNumber(expect) || expect.length === 1) { - msgExpect = ", expecting " + this.getTokenName(expect); - } - msg += msgExpect; - } - return this.raiseError(msg, msgExpect, expect, token); -}; - -/** - * Creates a new AST node - */ -parser.prototype.node = function(name) { - if (this.extractDoc) { - if (this._docIndex < this._docs.length) { - const docs = this._docs.slice(this._docIndex); - this._docIndex = this._docs.length; - return this.ast.prepare(name, docs, this); - } - } - return this.ast.prepare(name, null, this); -}; - -/** - * expects an end of statement or end of file - * @return {boolean} - */ -parser.prototype.expectEndOfStatement = function(node) { - if (this.token === ";") { - // include only real ';' statements - // https://github.com/glayzzle/php-parser/issues/164 - if (node && this.lexer.yytext === ";") { - node.includeToken(this); - } - } else if (this.token !== this.tok.T_INLINE_HTML && this.token !== this.EOF) { - this.error(";"); - return false; - } - this.next(); - return true; -}; - -/** outputs some debug information on current token **/ -const ignoreStack = ["parser.next"]; -parser.prototype.showlog = function() { - const stack = new Error().stack.split("\n"); - let line; - for (let offset = 2; offset < stack.length; offset++) { - line = stack[offset].trim(); - let found = false; - for (let i = 0; i < ignoreStack.length; i++) { - if (line.substring(3, 3 + ignoreStack[i].length) === ignoreStack[i]) { - found = true; - break; - } - } - if (!found) { - break; - } - } - // eslint-disable-next-line no-console - console.log( - "Line " + - this.lexer.yylloc.first_line + - " : " + - this.getTokenName(this.token) + - ">" + - this.lexer.yytext + - "<" + - " @-->" + - line - ); - return this; -}; - -/** - * Force the parser to check the current token. - * - * If the current token does not match to expected token, - * the an error will be raised. - * - * If the suppressError mode is activated, then the error will - * be added to the program error stack and this function will return `false`. - * - * @param {String|Number} token - * @return {boolean} - * @throws Error - */ -parser.prototype.expect = function(token) { - if (Array.isArray(token)) { - if (token.indexOf(this.token) === -1) { - this.error(token); - return false; - } - } else if (this.token != token) { - this.error(token); - return false; - } - return true; -}; - -/** - * Returns the current token contents - * @return {String} - */ -parser.prototype.text = function() { - return this.lexer.yytext; -}; - -/** consume the next token **/ -parser.prototype.next = function() { - // prepare the back command - if (this.token !== ";" || this.lexer.yytext === ";") { - // ignore '?>' from automated resolution - // https://github.com/glayzzle/php-parser/issues/168 - this.prev = [ - this.lexer.yylloc.last_line, - this.lexer.yylloc.last_column, - this.lexer.offset - ]; - } - - // eating the token - this.lex(); - - // showing the debug - if (this.debug) { - this.showlog(); - } - - // handling comments - if (this.extractDoc) { - while ( - this.token === this.tok.T_COMMENT || - this.token === this.tok.T_DOC_COMMENT - ) { - // APPEND COMMENTS - if (this.token === this.tok.T_COMMENT) { - this._docs.push(this.read_comment()); - } else { - this._docs.push(this.read_doc_comment()); - } - } - } - - return this; -}; - -/** - * Eating a token - */ -parser.prototype.lex = function() { - // append on token stack - if (this.extractTokens) { - do { - // the token - this.token = this.lexer.lex() || this.EOF; - if (this.token === this.EOF) return this; - let entry = this.lexer.yytext; - if (this.lexer.engine.tokens.values.hasOwnProperty(this.token)) { - entry = [ - this.lexer.engine.tokens.values[this.token], - entry, - this.lexer.yylloc.first_line, - this.lexer.yylloc.first_offset, - this.lexer.offset - ]; - } else { - entry = [ - null, - entry, - this.lexer.yylloc.first_line, - this.lexer.yylloc.first_offset, - this.lexer.offset - ]; - } - this._tokens.push(entry); - if (this.token === this.tok.T_CLOSE_TAG) { - // https://github.com/php/php-src/blob/7ff186434e82ee7be7c59d0db9a976641cf7b09c/Zend/zend_compile.c#L1680 - this.token = ";"; - return this; - } else if (this.token === this.tok.T_OPEN_TAG_WITH_ECHO) { - this.token = this.tok.T_ECHO; - return this; - } - } while ( - this.token === this.tok.T_WHITESPACE || // ignore white space - (!this.extractDoc && - (this.token === this.tok.T_COMMENT || // ignore single lines comments - this.token === this.tok.T_DOC_COMMENT)) || // ignore doc comments - // ignore open tags - this.token === this.tok.T_OPEN_TAG - ); - } else { - this.token = this.lexer.lex() || this.EOF; - } - return this; -}; - -/** - * Check if token is of specified type - */ -parser.prototype.is = function(type) { - if (Array.isArray(type)) { - return type.indexOf(this.token) !== -1; - } - return this.entries[type].has(this.token); -}; - -// extends the parser with syntax files -[ - require("./parser/array.js"), - require("./parser/class.js"), - require("./parser/comment.js"), - require("./parser/expr.js"), - require("./parser/function.js"), - require("./parser/if.js"), - require("./parser/loops.js"), - require("./parser/main.js"), - require("./parser/namespace.js"), - require("./parser/scalar.js"), - require("./parser/statement.js"), - require("./parser/switch.js"), - require("./parser/try.js"), - require("./parser/utils.js"), - require("./parser/variable.js") -].forEach(function(ext) { - for (const k in ext) { - parser.prototype[k] = ext[k]; - } -}); - -module.exports = parser; diff --git a/src/parser/array.js b/src/parser/array.js deleted file mode 100644 index 0f8008f64..000000000 --- a/src/parser/array.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const ArrayExpr = "array"; -const ArrayEntry = "entry"; - -module.exports = { - /** - * Parse an array - * ```ebnf - * array ::= T_ARRAY '(' array_pair_list ')' | - * '[' array_pair_list ']' - * ``` - */ - read_array: function() { - let expect = null; - let shortForm = false; - const result = this.node(ArrayExpr); - - if (this.token === this.tok.T_ARRAY) { - this.next().expect("("); - expect = ")"; - } else { - shortForm = true; - expect = "]"; - } - let items = []; - if (this.next().token !== expect) { - items = this.read_array_pair_list(shortForm); - } - // check non empty entries - /*for(let i = 0, size = items.length - 1; i < size; i++) { - if (items[i] === null) { - this.raiseError( - "Cannot use empty array elements in arrays" - ); - } - }*/ - this.expect(expect); - this.next(); - return result(shortForm, items); - }, - /** - * Reads an array of items - * ```ebnf - * array_pair_list ::= array_pair (',' array_pair?)* - * ``` - */ - read_array_pair_list: function(shortForm) { - const self = this; - return this.read_list( - function() { - return self.read_array_pair(shortForm); - }, - ",", - true - ); - }, - /** - * Reads an entry - * array_pair: - * expr T_DOUBLE_ARROW expr - * | expr - * | expr T_DOUBLE_ARROW '&' variable - * | '&' variable - * | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' - * | T_LIST '(' array_pair_list ')' - */ - read_array_pair: function(shortForm) { - if ( - this.token === "," || - (!shortForm && this.token === ")") || - (shortForm && this.token === "]") - ) { - return null; - } - if (this.token === "&") { - return this.next().read_variable(true, false, true); - } else { - const entry = this.node(ArrayEntry); - const expr = this.read_expr(); - if (this.token === this.tok.T_DOUBLE_ARROW) { - if (this.next().token === "&") { - return entry(expr, this.next().read_variable(true, false, true)); - } else { - return entry(expr, this.read_expr()); - } - } - return expr; - } - }, - /** - * ```ebnf - * dim_offset ::= expr? - * ``` - */ - read_dim_offset: function() { - if (this.token == "]") return false; - return this.read_expr(); - } -}; diff --git a/src/parser/class.js b/src/parser/class.js deleted file mode 100644 index 221904dfc..000000000 --- a/src/parser/class.js +++ /dev/null @@ -1,461 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * reading a class - * ```ebnf - * class ::= class_scope? T_CLASS T_STRING (T_EXTENDS NAMESPACE_NAME)? (T_IMPLEMENTS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' CLASS_BODY '}' - * ``` - */ - read_class: function(flag) { - const result = this.node("class"); - this.expect(this.tok.T_CLASS); - this.next().expect(this.tok.T_STRING); - const propName = this.text(); - let propExtends = null; - let propImplements = null; - if (this.next().token == this.tok.T_EXTENDS) { - propExtends = this.next().read_namespace_name(); - } - if (this.token == this.tok.T_IMPLEMENTS) { - propImplements = this.next().read_name_list(); - } - this.expect("{"); - const body = this.next().read_class_body(); - return result(propName, propExtends, propImplements, body, flag); - }, - /** - * Read the class visibility - * ```ebnf - * class_scope ::= (T_FINAL | T_ABSTRACT)? - * ``` - */ - read_class_scope: function() { - const result = this.token; - if (result == this.tok.T_FINAL) { - this.next(); - return [0, 0, 2]; - } else if (result == this.tok.T_ABSTRACT) { - this.next(); - return [0, 0, 1]; - } - return [0, 0, 0]; - }, - /** - * Reads a class body - * ```ebnf - * class_body ::= (member_flags? (T_VAR | T_STRING | T_FUNCTION))* - * ``` - */ - read_class_body: function() { - let result = []; - - while (this.token !== this.EOF && this.token !== "}") { - if (this.token === this.tok.T_COMMENT) { - result.push(this.read_comment()); - continue; - } - - if (this.token === this.tok.T_DOC_COMMENT) { - result.push(this.read_doc_comment()); - continue; - } - - // check T_USE trait - if (this.token === this.tok.T_USE) { - result = result.concat(this.next().read_trait_use_statement()); - continue; - } - - // read member flags - const flags = this.read_member_flags(false); - - // check constant - if (this.token === this.tok.T_CONST) { - const constants = this.read_constant_list(flags); - if (this.expect(";")) { - this.next(); - } - result = result.concat(constants); - continue; - } - - // jump over T_VAR then land on T_VARIABLE - if (this.token === this.tok.T_VAR) { - this.next().expect(this.tok.T_VARIABLE); - flags[0] = flags[1] = 0; // public & non static var - } - - if (this.token === this.tok.T_VARIABLE) { - // reads a variable - const variables = this.read_variable_list(flags); - this.expect(";"); - this.next(); - result = result.concat(variables); - } else if (this.token === this.tok.T_FUNCTION) { - // reads a function - result.push(this.read_function(false, flags)); - } else { - // raise an error - this.error([ - this.tok.T_CONST, - this.tok.T_VARIABLE, - this.tok.T_FUNCTION - ]); - // ignore token - this.next(); - } - } - this.expect("}"); - this.next(); - return result; - }, - /** - * Reads variable list - * ```ebnf - * variable_list ::= (variable_declaration ',')* variable_declaration - * ``` - */ - read_variable_list: function(flags) { - return this.read_list( - /** - * Reads a variable declaration - * - * ```ebnf - * variable_declaration ::= T_VARIABLE '=' scalar - * ``` - */ - function read_variable_declaration() { - const result = this.node("property"); - this.expect(this.tok.T_VARIABLE); - const name = this.text().substring(1); // ignore $ - this.next(); - if (this.token === ";" || this.token === ",") { - return result(name, null, flags); - } else if (this.token === "=") { - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L815 - return result(name, this.next().read_expr(), flags); - } else { - this.expect([",", ";", "="]); - return result(name, null, flags); - } - }, - "," - ); - }, - /** - * Reads constant list - * ```ebnf - * constant_list ::= T_CONST (constant_declaration ',')* constant_declaration - * ``` - */ - read_constant_list: function(flags) { - if (this.expect(this.tok.T_CONST)) { - this.next(); - } - return this.read_list( - /** - * Reads a constant declaration - * - * ```ebnf - * constant_declaration ::= (T_STRING | IDENTIFIER) '=' expr - * ``` - * @return {Constant} [:link:](AST.md#constant) - */ - function read_constant_declaration() { - const result = this.node("classconstant"); - let name = null; - let value = null; - if ( - this.token === this.tok.T_STRING || - (this.php7 && this.is("IDENTIFIER")) - ) { - name = this.text(); - this.next(); - } else { - this.expect("IDENTIFIER"); - } - if (this.expect("=")) { - value = this.next().read_expr(); - } - return result(name, value, flags); - }, - "," - ); - }, - /** - * Read member flags - * @return array - * 1st index : 0 => public, 1 => protected, 2 => private - * 2nd index : 0 => instance member, 1 => static member - * 3rd index : 0 => normal, 1 => abstract member, 2 => final member - */ - read_member_flags: function(asInterface) { - const result = [-1, -1, -1]; - if (this.is("T_MEMBER_FLAGS")) { - let idx = 0, - val = 0; - do { - switch (this.token) { - case this.tok.T_PUBLIC: - idx = 0; - val = 0; - break; - case this.tok.T_PROTECTED: - idx = 0; - val = 1; - break; - case this.tok.T_PRIVATE: - idx = 0; - val = 2; - break; - case this.tok.T_STATIC: - idx = 1; - val = 1; - break; - case this.tok.T_ABSTRACT: - idx = 2; - val = 1; - break; - case this.tok.T_FINAL: - idx = 2; - val = 2; - break; - } - if (asInterface) { - if (idx == 0 && val == 2) { - // an interface can't be private - this.expect([this.tok.T_PUBLIC, this.tok.T_PROTECTED]); - val = -1; - } else if (idx == 2 && val == 1) { - // an interface cant be abstract - this.error(); - val = -1; - } - } - if (result[idx] !== -1) { - // already defined flag - this.error(); - } else if (val !== -1) { - result[idx] = val; - } - } while (this.next().is("T_MEMBER_FLAGS")); - } - - if (result[1] == -1) result[1] = 0; - if (result[2] == -1) result[2] = 0; - return result; - }, - /** - * reading an interface - * ```ebnf - * interface ::= T_INTERFACE T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' INTERFACE_BODY '}' - * ``` - */ - read_interface: function() { - const result = this.node("interface"); - let name = null; - let body = null; - let propExtends = null; - if (this.expect(this.tok.T_INTERFACE)) { - this.next(); - } - if (this.expect(this.tok.T_STRING)) { - name = this.text(); - this.next(); - } - if (this.token === this.tok.T_EXTENDS) { - propExtends = this.next().read_name_list(); - } - if (this.expect("{")) { - body = this.next().read_interface_body(); - } - return result(name, propExtends, body); - }, - /** - * Reads an interface body - * ```ebnf - * interface_body ::= (member_flags? (T_CONST | T_FUNCTION))* - * ``` - */ - read_interface_body: function() { - let result = []; - - while (this.token !== this.EOF && this.token !== "}") { - if (this.token === this.tok.T_COMMENT) { - result.push(this.read_comment()); - continue; - } - - if (this.token === this.tok.T_DOC_COMMENT) { - result.push(this.read_doc_comment()); - continue; - } - - // read member flags - const flags = this.read_member_flags(true); - - // check constant - if (this.token == this.tok.T_CONST) { - const constants = this.read_constant_list(flags); - if (this.expect(";")) { - this.next(); - } - result = result.concat(constants); - } else if (this.token === this.tok.T_FUNCTION) { - // reads a function - const method = this.read_function_declaration(2, flags); - method.parseFlags(flags); - result.push(method); - if (this.expect(";")) { - this.next(); - } - } else { - // raise an error - this.error([this.tok.T_CONST, this.tok.T_FUNCTION]); - this.next(); - } - } - if (this.expect("}")) { - this.next(); - } - return result; - }, - /** - * reading a trait - * ```ebnf - * trait ::= T_TRAIT T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' FUNCTION* '}' - * ``` - */ - read_trait: function() { - const result = this.node("trait"); - let propName = null; - let propExtends = null; - let propImplements = null; - let body = null; - if (this.expect(this.tok.T_TRAIT)) { - this.next(); - } - if (this.expect(this.tok.T_STRING)) { - propName = this.text(); - } - if (this.next().token == this.tok.T_EXTENDS) { - propExtends = this.next().read_namespace_name(); - } - if (this.token == this.tok.T_IMPLEMENTS) { - propImplements = this.next().read_name_list(); - } - if (this.expect("{")) { - body = this.next().read_class_body(); - } - return result(propName, propExtends, propImplements, body); - }, - /** - * reading a use statement - * ```ebnf - * trait_use_statement ::= namespace_name (',' namespace_name)* ('{' trait_use_alias '}')? - * ``` - */ - read_trait_use_statement: function() { - // defines use statements - const node = this.node("traituse"); - const traits = [this.read_namespace_name()]; - let adaptations = null; - while (this.token === ",") { - traits.push(this.next().read_namespace_name()); - } - if (this.token === "{") { - adaptations = []; - // defines alias statements - while (this.next().token !== this.EOF) { - if (this.token === "}") break; - adaptations.push(this.read_trait_use_alias()); - this.expect(";"); - } - if (this.expect("}")) { - this.next(); - } - } else { - if (this.expect(";")) { - this.next(); - } - } - return node(traits, adaptations); - }, - /** - * Reading trait alias - * ```ebnf - * trait_use_alias ::= namespace_name ( T_DOUBLE_COLON T_STRING )? (T_INSTEADOF namespace_name) | (T_AS member_flags? T_STRING) - * ``` - * name list : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L303 - * trait adaptation : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L742 - */ - read_trait_use_alias: function() { - const node = this.node(); - let trait = null; - let method; - - if (this.is("IDENTIFIER")) { - method = this.text(); - this.next(); - } else { - method = this.read_namespace_name(); - - if (this.token === this.tok.T_DOUBLE_COLON) { - this.next(); - if ( - this.token === this.tok.T_STRING || - (this.php7 && this.is("IDENTIFIER")) - ) { - trait = method; - method = this.text(); - this.next(); - } else { - this.expect(this.tok.T_STRING); - } - } else { - // convert identifier as string - method = method.name; - } - } - - // handle trait precedence - if (this.token === this.tok.T_INSTEADOF) { - return node( - "traitprecedence", - trait, - method, - this.next().read_name_list() - ); - } else if (this.token === this.tok.T_AS) { - // handle trait alias - let flags = null; - let alias = null; - if (this.next().is("T_MEMBER_FLAGS")) { - flags = this.read_member_flags(); - } - - if ( - this.token === this.tok.T_STRING || - (this.php7 && this.is("IDENTIFIER")) - ) { - alias = this.text(); - this.next(); - } else if (flags === false) { - // no visibility flags and no name => too bad - this.expect(this.tok.T_STRING); - } - - return node("traitalias", trait, method, alias, flags); - } - - // handle errors - this.expect([this.tok.T_AS, this.tok.T_INSTEADOF]); - return node("traitalias", trait, method, null, null); - } -}; diff --git a/src/parser/comment.js b/src/parser/comment.js deleted file mode 100644 index 1be7a1594..000000000 --- a/src/parser/comment.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * Comments with // or # or / * ... * / - */ - read_comment: function() { - const text = this.text(); - let result = this.ast.prepare( - text.substring(0, 2) === "/*" ? "commentblock" : "commentline", - null, - this - ); - // handle location on comment - const prev = this.prev; - this.prev = [ - this.lexer.yylloc.last_line, - this.lexer.yylloc.last_column, - this.lexer.offset - ]; - this.lex(); - result = result(text); - this.prev = prev; - return result; - }, - /** - * Comments with / ** ... * / - */ - read_doc_comment: function() { - let result = this.ast.prepare("commentblock", null, this); - const text = this.text(); - const prev = this.prev; - this.prev = [ - this.lexer.yylloc.last_line, - this.lexer.yylloc.last_column, - this.lexer.offset - ]; - this.lex(); - result = result(text); - this.prev = prev; - return result; - } -}; diff --git a/src/parser/expr.js b/src/parser/expr.js deleted file mode 100644 index 3943e9834..000000000 --- a/src/parser/expr.js +++ /dev/null @@ -1,520 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - read_expr: function() { - const result = this.node(); - const expr = this.read_expr_item(); - // binary operations - if (this.token === "|") - return result("bin", "|", expr, this.next().read_expr()); - if (this.token === "&") - return result("bin", "&", expr, this.next().read_expr()); - if (this.token === "^") - return result("bin", "^", expr, this.next().read_expr()); - if (this.token === ".") - return result("bin", ".", expr, this.next().read_expr()); - if (this.token === "+") - return result("bin", "+", expr, this.next().read_expr()); - if (this.token === "-") - return result("bin", "-", expr, this.next().read_expr()); - if (this.token === "*") - return result("bin", "*", expr, this.next().read_expr()); - if (this.token === "/") - return result("bin", "/", expr, this.next().read_expr()); - if (this.token === "%") - return result("bin", "%", expr, this.next().read_expr()); - if (this.token === this.tok.T_POW) - return result("bin", "**", expr, this.next().read_expr()); - if (this.token === this.tok.T_SL) - return result("bin", "<<", expr, this.next().read_expr()); - if (this.token === this.tok.T_SR) - return result("bin", ">>", expr, this.next().read_expr()); - // more binary operations (formerly bool) - if (this.token === this.tok.T_BOOLEAN_OR) - return result("bin", "||", expr, this.next().read_expr()); - if (this.token === this.tok.T_LOGICAL_OR) - return result("bin", "or", expr, this.next().read_expr()); - if (this.token === this.tok.T_BOOLEAN_AND) - return result("bin", "&&", expr, this.next().read_expr()); - if (this.token === this.tok.T_LOGICAL_AND) - return result("bin", "and", expr, this.next().read_expr()); - if (this.token === this.tok.T_LOGICAL_XOR) - return result("bin", "xor", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_IDENTICAL) - return result("bin", "===", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_NOT_IDENTICAL) - return result("bin", "!==", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_EQUAL) - return result("bin", "==", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_NOT_EQUAL) - return result("bin", "!=", expr, this.next().read_expr()); - if (this.token === "<") - return result("bin", "<", expr, this.next().read_expr()); - if (this.token === ">") - return result("bin", ">", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_SMALLER_OR_EQUAL) - return result("bin", "<=", expr, this.next().read_expr()); - if (this.token === this.tok.T_IS_GREATER_OR_EQUAL) - return result("bin", ">=", expr, this.next().read_expr()); - if (this.token === this.tok.T_SPACESHIP) - return result("bin", "<=>", expr, this.next().read_expr()); - if (this.token === this.tok.T_INSTANCEOF) - return result("bin", "instanceof", expr, this.next().read_expr()); - - // extra operations : - // $username = $_GET['user'] ?? 'nobody'; - if (this.token === this.tok.T_COALESCE) - return result("bin", "??", expr, this.next().read_expr()); - - // extra operations : - // $username = $_GET['user'] ? true : false; - if (this.token === "?") { - let trueArg = null; - if (this.next().token !== ":") { - trueArg = this.read_expr(); - } - this.expect(":") && this.next(); - return result("retif", expr, trueArg, this.read_expr()); - } - - return expr; - }, - - /** - * Reads a cast expression - */ - read_expr_cast: function(type) { - return this.node("cast")(type, this.text(), this.next().read_expr()); - }, - - /** - * ```ebnf - * Reads an expression - * expr ::= @todo - * ``` - */ - read_expr_item: function() { - let result, expr; - if (this.token === "@") return this.node("silent")(this.next().read_expr()); - if (this.token === "+") - return this.node("unary")("+", this.next().read_expr()); - if (this.token === "!") - return this.node("unary")("!", this.next().read_expr()); - if (this.token === "~") - return this.node("unary")("~", this.next().read_expr()); - - if (this.token === "-") { - result = this.node(); - this.next(); - if ( - this.token === this.tok.T_LNUMBER || - this.token === this.tok.T_DNUMBER - ) { - // negative number - result = result("number", "-" + this.text(), null); - this.next(); - return result; - } else { - return result("unary", "-", this.read_expr()); - } - } - - if (this.token === "(") { - expr = this.next().read_expr(); - expr.parenthesizedExpression = true; - this.expect(")") && this.next(); - return this.handleDereferencable(expr); - } - - if (this.token === "`") { - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1048 - return this.next().read_encapsed_string("`"); - } - - if (this.token === this.tok.T_LIST) { - let assign = null; - const isInner = this.innerList; - result = this.node("list"); - if (!isInner) { - assign = this.node("assign"); - } - if (this.next().expect("(")) { - this.next(); - } - - if (!this.innerList) this.innerList = true; - - // reads inner items - const assignList = this.read_array_pair_list(false); - if (this.expect(")")) { - this.next(); - } - - // check if contains at least one assignment statement - let hasItem = false; - for (let i = 0; i < assignList.length; i++) { - if (assignList[i] !== null) { - hasItem = true; - break; - } - } - if (!hasItem) { - this.raiseError( - "Fatal Error : Cannot use empty list on line " + - this.lexer.yylloc.first_line - ); - } - - // handles the node resolution - if (!isInner) { - this.innerList = false; - if (this.expect("=")) { - return assign( - result(assignList, false), - this.next().read_expr(), - "=" - ); - } else { - // error fallback : list($a, $b); - return result(assignList, false); - } - } else { - return result(assignList, false); - } - } - - if (this.token === this.tok.T_CLONE) - return this.node("clone")(this.next().read_expr()); - - switch (this.token) { - case this.tok.T_INC: - return this.node("pre")( - "+", - this.next().read_variable(false, false, false) - ); - - case this.tok.T_DEC: - return this.node("pre")( - "-", - this.next().read_variable(false, false, false) - ); - - case this.tok.T_NEW: - return this.next().read_new_expr(); - - case this.tok.T_ISSET: { - result = this.node("isset"); - if (this.next().expect("(")) { - this.next(); - } - const args = this.read_list(this.read_expr, ","); - if (this.expect(")")) { - this.next(); - } - return result(args); - } - case this.tok.T_EMPTY: { - result = this.node("empty"); - if (this.next().expect("(")) { - this.next(); - } - const arg = this.read_expr(); - if (this.expect(")")) { - this.next(); - } - return result([arg]); - } - case this.tok.T_INCLUDE: - return this.node("include")(false, false, this.next().read_expr()); - - case this.tok.T_INCLUDE_ONCE: - return this.node("include")(true, false, this.next().read_expr()); - - case this.tok.T_REQUIRE: - return this.node("include")(false, true, this.next().read_expr()); - - case this.tok.T_REQUIRE_ONCE: - return this.node("include")(true, true, this.next().read_expr()); - - case this.tok.T_EVAL: - result = this.node("eval"); - if (this.next().expect("(")) { - this.next(); - } - expr = this.read_expr(); - if (this.expect(")")) { - this.next(); - } - return result(expr); - - case this.tok.T_INT_CAST: - return this.read_expr_cast("int"); - - case this.tok.T_DOUBLE_CAST: - return this.read_expr_cast("float"); - - case this.tok.T_STRING_CAST: - return this.read_expr_cast( - this.text().indexOf("binary") !== -1 ? "binary" : "string" - ); - - case this.tok.T_ARRAY_CAST: - return this.read_expr_cast("array"); - - case this.tok.T_OBJECT_CAST: - return this.read_expr_cast("object"); - - case this.tok.T_BOOL_CAST: - return this.read_expr_cast("bool"); - - case this.tok.T_UNSET_CAST: - return this.read_expr_cast("unset"); - - case this.tok.T_EXIT: { - const useDie = this.lexer.yytext.toLowerCase() === "die"; - result = this.node("exit"); - let status = null; - if (this.next().token === "(") { - if (this.next().token !== ")") { - status = this.read_expr(); - if (this.expect(")")) { - this.next(); - } - } else { - this.next(); - } - } - return result(status, useDie); - } - - case this.tok.T_PRINT: - return this.node("print")(this.next().read_expr()); - - // T_YIELD (expr (T_DOUBLE_ARROW expr)?)? - case this.tok.T_YIELD: { - let value = null; - let key = null; - result = this.node("yield"); - if (this.next().is("EXPR")) { - // reads the yield return value - value = this.read_expr(); - if (this.token === this.tok.T_DOUBLE_ARROW) { - // reads the yield returned key - key = value; - value = this.next().read_expr(); - } - } - return result(value, key); - } - - // T_YIELD_FROM expr - case this.tok.T_YIELD_FROM: - result = this.node("yieldfrom"); - expr = this.next().read_expr(); - return result(expr); - - case this.tok.T_FUNCTION: - return this.read_function(true); - - case this.tok.T_STATIC: { - const backup = [this.token, this.lexer.getState()]; - if (this.next().token === this.tok.T_FUNCTION) { - // handles static function - return this.read_function(true, [0, 1, 0]); - } else { - // rollback - this.lexer.tokens.push(backup); - this.next(); - } - } - } - - // SCALAR | VARIABLE - if (this.is("VARIABLE")) { - result = this.node(); - expr = this.read_variable(false, false, false); - - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L877 - // should accept only a variable - const isConst = - expr.kind === "constref" || - (expr.kind === "staticlookup" && expr.offset.kind === "constref"); - - // VARIABLES SPECIFIC OPERATIONS - switch (this.token) { - case "=": { - if (isConst) this.error("VARIABLE"); - let right; - if (this.next().token == "&") { - if (this.next().token === this.tok.T_NEW) { - right = this.next().read_new_expr(); - } else { - right = this.read_variable(false, false, true); - } - } else { - right = this.read_expr(); - } - return result("assign", expr, right, "="); - } - - // operations : - case this.tok.T_PLUS_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "+="); - - case this.tok.T_MINUS_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "-="); - - case this.tok.T_MUL_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "*="); - - case this.tok.T_POW_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "**="); - - case this.tok.T_DIV_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "/="); - - case this.tok.T_CONCAT_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), ".="); - - case this.tok.T_MOD_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "%="); - - case this.tok.T_AND_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "&="); - - case this.tok.T_OR_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "|="); - - case this.tok.T_XOR_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "^="); - - case this.tok.T_SL_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), "<<="); - - case this.tok.T_SR_EQUAL: - if (isConst) this.error("VARIABLE"); - return result("assign", expr, this.next().read_expr(), ">>="); - - case this.tok.T_INC: - if (isConst) this.error("VARIABLE"); - this.next(); - return result("post", "+", expr); - case this.tok.T_DEC: - if (isConst) this.error("VARIABLE"); - this.next(); - return result("post", "-", expr); - } - } else if (this.is("SCALAR")) { - result = this.node(); - expr = this.read_scalar(); - if (expr.kind === "array" && expr.shortForm && this.token === "=") { - // list assign - let list = this.node("list")(expr.items, true); - if (expr.loc) list.loc = expr.loc; - let right = this.next().read_expr(); - return result("assign", list, right, "="); - } - // classic array - return this.handleDereferencable(expr); - } else { - this.error("EXPR"); - this.next(); - } - - // returns variable | scalar - return expr; - }, - /** - * ```ebnf - * new_expr ::= T_NEW (namespace_name function_argument_list) | (T_CLASS ... class declaration) - * ``` - * https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L850 - */ - read_new_expr: function() { - const result = this.node("new"); - let args = []; - if (this.token === this.tok.T_CLASS) { - const what = this.node("class"); - // Annonymous class declaration - let propExtends = null, - propImplements = null, - body = null; - if (this.next().token === "(") { - args = this.read_function_argument_list(); - } - if (this.token == this.tok.T_EXTENDS) { - propExtends = this.next().read_namespace_name(); - } - if (this.token == this.tok.T_IMPLEMENTS) { - propImplements = this.next().read_name_list(); - } - if (this.expect("{")) { - body = this.next().read_class_body(); - } - return result( - what(null, propExtends, propImplements, body, [0, 0, 0]), - args - ); - } - // Already existing class - const name = this.read_class_name_reference(); - if (this.token === "(") { - args = this.read_function_argument_list(); - } - return result(name, args); - }, - /** - * Reads a class name - * ```ebnf - * class_name_reference ::= namespace_name | variable - * ``` - */ - read_class_name_reference: function() { - if ( - this.token === this.tok.T_NS_SEPARATOR || - this.token === this.tok.T_STRING || - this.token === this.tok.T_NAMESPACE - ) { - let result = this.read_namespace_name(); - if (this.token === this.tok.T_DOUBLE_COLON) { - result = this.read_static_getter(result); - } - return result; - } else if (this.is("VARIABLE")) { - return this.read_variable(true, false, false); - } else { - this.expect([this.tok.T_STRING, "VARIABLE"]); - } - }, - handleDereferencable: function(expr) { - while (this.token !== this.EOF) { - if (this.token === this.tok.T_OBJECT_OPERATOR) { - expr = this.recursive_variable_chain_scan(expr, false); - } else if (this.token === this.tok.T_CURLY_OPEN || this.token === "[") { - expr = this.read_dereferencable(expr); - } else if (this.token === "(") { - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1118 - expr = this.node("call")(expr, this.read_function_argument_list()); - } else { - return expr; - } - } - return expr; - } -}; diff --git a/src/parser/function.js b/src/parser/function.js deleted file mode 100644 index d41c5b024..000000000 --- a/src/parser/function.js +++ /dev/null @@ -1,257 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * checks if current token is a reference keyword - */ - is_reference: function() { - if (this.token == "&") { - this.next(); - return true; - } - return false; - }, - /** - * checks if current token is a variadic keyword - */ - is_variadic: function() { - if (this.token === this.tok.T_ELLIPSIS) { - this.next(); - return true; - } - return false; - }, - /** - * reading a function - * ```ebnf - * function ::= function_declaration code_block - * ``` - */ - read_function: function(closure, flag) { - const result = this.read_function_declaration( - closure ? 1 : flag ? 2 : 0, - flag && flag[1] === 1 - ); - if (flag && flag[2] == 1) { - // abstract function : - result.parseFlags(flag); - if (this.expect(";")) { - this.next(); - } - } else { - if (this.expect("{")) { - result.body = this.read_code_block(false); - if (result.loc && result.body.loc) { - result.loc.end = result.body.loc.end; - } - } - if (!closure && flag) { - result.parseFlags(flag); - } - } - return result; - }, - /** - * reads a function declaration (without his body) - * ```ebnf - * function_declaration ::= T_FUNCTION '&'? T_STRING '(' parameter_list ')' - * ``` - */ - read_function_declaration: function(type, isStatic) { - let nodeName = "function"; - if (type === 1) { - nodeName = "closure"; - } else if (type === 2) { - nodeName = "method"; - } - const result = this.node(nodeName); - - if (this.expect(this.tok.T_FUNCTION)) { - this.next(); - } - const isRef = this.is_reference(); - let name = false, - use = [], - returnType = null, - nullable = false; - if (type !== 1) { - if (type === 2) { - if ( - this.token === this.tok.T_STRING || - (this.php7 && this.is("IDENTIFIER")) - ) { - name = this.text(); - this.next(); - } else { - this.error("IDENTIFIER"); - } - } else { - if (this.expect(this.tok.T_STRING)) { - name = this.text(); - } - this.next(); - } - } - if (this.expect("(")) this.next(); - const params = this.read_parameter_list(); - if (this.expect(")")) this.next(); - if (type === 1 && this.token === this.tok.T_USE) { - if (this.next().expect("(")) this.next(); - use = this.read_list(this.read_lexical_var, ","); - if (this.expect(")")) this.next(); - } - if (this.token === ":") { - if (this.next().token === "?") { - nullable = true; - this.next(); - } - returnType = this.read_type(); - } - if (type === 1) { - // closure - return result(params, isRef, use, returnType, nullable, isStatic); - } - return result(name, params, isRef, returnType, nullable); - }, - /** - * ```ebnf - * lexical_var ::= '&'? T_VARIABLE - * ``` - */ - read_lexical_var: function() { - const result = this.node("variable"); - let isRef = false; - if (this.token === "&") { - isRef = true; - this.next(); - } - this.expect(this.tok.T_VARIABLE); - const name = this.text().substring(1); - this.next(); - return result(name, isRef, false); - }, - /** - * reads a list of parameters - * ```ebnf - * parameter_list ::= (parameter ',')* parameter? - * ``` - */ - read_parameter_list: function() { - const result = []; - if (this.token != ")") { - while (this.token != this.EOF) { - result.push(this.read_parameter()); - if (this.token == ",") { - this.next(); - } else if (this.token == ")") { - break; - } else { - this.error([",", ")"]); - break; - } - } - } - return result; - }, - /** - * ```ebnf - * parameter ::= type? '&'? T_ELLIPSIS? T_VARIABLE ('=' expr)? - * ``` - * @see https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L640 - */ - read_parameter: function() { - const node = this.node("parameter"); - let name = null; - let value = null; - let type = null; - let nullable = false; - if (this.token === "?") { - this.next(); - nullable = true; - } - type = this.read_type(); - if (nullable && !type) { - this.raiseError( - "Expecting a type definition combined with nullable operator" - ); - } - const isRef = this.is_reference(); - const isVariadic = this.is_variadic(); - if (this.expect(this.tok.T_VARIABLE)) { - name = this.text().substring(1); - this.next(); - } - if (this.token == "=") { - value = this.next().read_expr(); - } - return node(name, type, value, isRef, isVariadic, nullable); - }, - /** - * Reads a list of arguments - * ```ebnf - * function_argument_list ::= '(' (argument_list (',' argument_list)*)? ')' - * ``` - */ - read_function_argument_list: function() { - const result = []; - let wasVariadic = false; - this.expect("(") && this.next(); - if (this.token !== ")") { - while (this.token != this.EOF) { - const argument = this.read_argument_list(); - if (argument) { - result.push(argument); - if (argument.kind === "variadic") { - wasVariadic = true; - } else if (wasVariadic) { - this.raiseError("Unexpected argument after a variadic argument"); - } - } - if (this.token === ",") { - this.next(); - } else break; - } - } - this.expect(")") && this.next(); - return result; - }, - /** - * ```ebnf - * argument_list ::= T_ELLIPSIS? expr - * ``` - */ - read_argument_list: function() { - if (this.token === this.tok.T_ELLIPSIS) { - return this.node("variadic")(this.next().read_expr()); - } - return this.read_expr(); - }, - /** - * read type hinting - * ```ebnf - * type ::= T_ARRAY | T_CALLABLE | namespace_name - * ``` - */ - read_type: function() { - const result = this.node("identifier"); - switch (this.token) { - case this.tok.T_ARRAY: - this.next(); - return result(["", "array"], false); - case this.tok.T_NAMESPACE: - case this.tok.T_NS_SEPARATOR: - case this.tok.T_STRING: - return this.read_namespace_name(); - case this.tok.T_CALLABLE: - this.next(); - return result(["", "callable"], false); - default: - return null; - } - } -}; diff --git a/src/parser/if.js b/src/parser/if.js deleted file mode 100644 index eff2a9e1c..000000000 --- a/src/parser/if.js +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * Reads an IF statement - * - * ```ebnf - * if ::= T_IF '(' expr ')' ':' ... - * ``` - */ - read_if: function() { - const result = this.node("if"); - let body = null; - let alternate = null; - let shortForm = false; - let test = null; - test = this.next().read_if_expr(); - - if (this.token === ":") { - shortForm = true; - this.next(); - body = this.node("block"); - const items = []; - while (this.token !== this.EOF && this.token !== this.tok.T_ENDIF) { - if (this.token === this.tok.T_ELSEIF) { - alternate = this.read_elseif_short(); - break; - } else if (this.token === this.tok.T_ELSE) { - alternate = this.read_else_short(); - break; - } - items.push(this.read_inner_statement()); - } - body = body(null, items); - this.expect(this.tok.T_ENDIF) && this.next(); - this.expectEndOfStatement(); - } else { - body = this.read_statement(); - if (this.token === this.tok.T_ELSEIF) { - alternate = this.read_if(); - } else if (this.token === this.tok.T_ELSE) { - alternate = this.next().read_statement(); - } - } - return result(test, body, alternate, shortForm); - }, - /** - * reads an if expression : '(' expr ')' - */ - read_if_expr: function() { - this.expect("(") && this.next(); - const result = this.read_expr(); - this.expect(")") && this.next(); - return result; - }, - /** - * reads an elseif (expr): statements - */ - read_elseif_short: function() { - const result = this.node("if"); - let alternate = null; - let test = null; - let body = null; - const items = []; - test = this.next().read_if_expr(); - if (this.expect(":")) this.next(); - body = this.node("block"); - while (this.token != this.EOF && this.token !== this.tok.T_ENDIF) { - if (this.token === this.tok.T_ELSEIF) { - alternate = this.read_elseif_short(); - break; - } else if (this.token === this.tok.T_ELSE) { - alternate = this.read_else_short(); - break; - } - items.push(this.read_inner_statement()); - } - body = body(null, items); - return result(test, body, alternate, true); - }, - /** - * - */ - read_else_short: function() { - const body = this.node("block"); - if (this.next().expect(":")) this.next(); - const items = []; - while (this.token != this.EOF && this.token !== this.tok.T_ENDIF) { - items.push(this.read_inner_statement()); - } - return body(null, items); - } -}; diff --git a/src/parser/loops.js b/src/parser/loops.js deleted file mode 100644 index f61b1a349..000000000 --- a/src/parser/loops.js +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * Reads a while statement - * ```ebnf - * while ::= T_WHILE (statement | ':' inner_statement_list T_ENDWHILE ';') - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L587 - * @return {While} - */ - read_while: function() { - const result = this.node("while"); - let test = null; - let body = null; - let shortForm = false; - if (this.expect("(")) this.next(); - test = this.read_expr(); - if (this.expect(")")) this.next(); - if (this.token === ":") { - shortForm = true; - body = this.read_short_form(this.tok.T_ENDWHILE); - } else { - body = this.read_statement(); - } - return result(test, body, shortForm); - }, - /** - * Reads a do / while loop - * ```ebnf - * do ::= T_DO statement T_WHILE '(' expr ')' ';' - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L423 - * @return {Do} - */ - read_do: function() { - const result = this.node("do"); - let test = null; - let body = null; - body = this.read_statement(); - if (this.expect(this.tok.T_WHILE)) { - if (this.next().expect("(")) this.next(); - test = this.read_expr(); - if (this.expect(")")) this.next(); - if (this.expect(";")) this.next(); - } - return result(test, body); - }, - /** - * Read a for incremental loop - * ```ebnf - * for ::= T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement - * for_statement ::= statement | ':' inner_statement_list T_ENDFOR ';' - * for_exprs ::= expr? (',' expr)* - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L425 - * @return {For} - */ - read_for: function() { - const result = this.node("for"); - let init = []; - let test = []; - let increment = []; - let body = null; - let shortForm = false; - if (this.expect("(")) this.next(); - if (this.token !== ";") { - init = this.read_list(this.read_expr, ","); - if (this.expect(";")) this.next(); - } else { - this.next(); - } - if (this.token !== ";") { - test = this.read_list(this.read_expr, ","); - if (this.expect(";")) this.next(); - } else { - this.next(); - } - if (this.token !== ")") { - increment = this.read_list(this.read_expr, ","); - if (this.expect(")")) this.next(); - } else { - this.next(); - } - if (this.token === ":") { - shortForm = true; - body = this.read_short_form(this.tok.T_ENDFOR); - } else { - body = this.read_statement(); - } - return result(init, test, increment, body, shortForm); - }, - /** - * Reads a foreach loop - * ```ebnf - * foreach ::= '(' expr T_AS foreach_variable (T_DOUBLE_ARROW foreach_variable)? ')' statement - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L438 - * @return {Foreach} - */ - read_foreach: function() { - const result = this.node("foreach"); - let source = null; - let key = null; - let value = null; - let body = null; - let shortForm = false; - if (this.expect("(")) this.next(); - source = this.read_expr(); - if (this.expect(this.tok.T_AS)) { - this.next(); - value = this.read_foreach_variable(); - if (this.token === this.tok.T_DOUBLE_ARROW) { - key = value; - value = this.next().read_foreach_variable(); - } - } - - // grammatically correct but not supported by PHP - if (key && key.kind === "list") { - this.raiseError("Fatal Error : Cannot use list as key element"); - } - - if (this.expect(")")) this.next(); - - if (this.token === ":") { - shortForm = true; - body = this.read_short_form(this.tok.T_ENDFOREACH); - } else { - body = this.read_statement(); - } - return result(source, key, value, body, shortForm); - }, - /** - * Reads a foreach variable statement - * ```ebnf - * foreach_variable = - * variable | - * '&' variable | - * T_LIST '(' assignment_list ')' | - * '[' assignment_list ']' - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L544 - * @return {Expression} - */ - read_foreach_variable: function() { - if (this.token === this.tok.T_LIST || this.token === "[") { - const isShort = this.token === "["; - const result = this.node("list"); - this.next(); - if (!isShort && this.expect("(")) this.next(); - const assignList = this.read_array_pair_list(isShort); - if (this.expect(isShort ? "]" : ")")) this.next(); - return result(assignList, isShort); - } else { - return this.read_variable(false, false, false); - } - } -}; diff --git a/src/parser/main.js b/src/parser/main.js deleted file mode 100644 index 33e54ce10..000000000 --- a/src/parser/main.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * ```ebnf - * start ::= (namespace | top_statement)* - * ``` - */ - read_start: function() { - if (this.token == this.tok.T_NAMESPACE) { - return this.read_namespace(); - } else { - return this.read_top_statement(); - } - } -}; diff --git a/src/parser/namespace.js b/src/parser/namespace.js deleted file mode 100644 index c2f959a08..000000000 --- a/src/parser/namespace.js +++ /dev/null @@ -1,172 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * Reads a namespace declaration block - * ```ebnf - * namespace ::= T_NAMESPACE namespace_name? '{' - * top_statements - * '}' - * | T_NAMESPACE namespace_name ';' top_statements - * ``` - * @see http://php.net/manual/en/language.namespaces.php - * @return {Namespace} - */ - read_namespace: function() { - const result = this.node("namespace"); - let body; - this.expect(this.tok.T_NAMESPACE) && this.next(); - if (this.token == "{") { - this.currentNamespace = [""]; - body = this.next().read_top_statements(); - this.expect("}") && this.next(); - return result([""], body, true); - } else { - const name = this.read_namespace_name(); - if (this.token == ";") { - this.currentNamespace = name; - body = this.next().read_top_statements(); - this.expect(this.EOF); - return result(name.name, body, false); - } else if (this.token == "{") { - this.currentNamespace = name; - body = this.next().read_top_statements(); - this.expect("}") && this.next(); - return result(name.name, body, true); - } else if (this.token === "(") { - // resolve ambuiguity between namespace & function call - name.resolution = this.ast.identifier.RELATIVE_NAME; - name.name = name.name.substring(1); - return this.node("call")(name, this.read_function_argument_list()); - } else { - this.error(["{", ";"]); - // graceful mode : - this.currentNamespace = name; - body = this.read_top_statements(); - this.expect(this.EOF); - return result(name, body, false); - } - } - }, - /** - * Reads a namespace name - * ```ebnf - * namespace_name ::= T_NS_SEPARATOR? (T_STRING T_NS_SEPARATOR)* T_STRING - * ``` - * @see http://php.net/manual/en/language.namespaces.rules.php - * @return {Identifier} - */ - read_namespace_name: function() { - const result = this.node("identifier"); - let relative = false; - if (this.token === this.tok.T_NAMESPACE) { - this.next().expect(this.tok.T_NS_SEPARATOR) && this.next(); - relative = true; - } - return result( - this.read_list(this.tok.T_STRING, this.tok.T_NS_SEPARATOR, true), - relative - ); - }, - /** - * Reads a use statement - * ```ebnf - * use_statement ::= T_USE - * use_type? use_declarations | - * use_type use_statement '{' use_declarations '}' | - * use_statement '{' use_declarations(=>typed) '}' - * ';' - * ``` - * @see http://php.net/manual/en/language.namespaces.importing.php - * @return {UseGroup} - */ - read_use_statement: function() { - let result = this.node("usegroup"); - let items = []; - let name = null; - this.expect(this.tok.T_USE) && this.next(); - const type = this.read_use_type(); - items.push(this.read_use_declaration(false)); - if (this.token === ",") { - items = items.concat(this.next().read_use_declarations(false)); - } else if (this.token === "{") { - name = items[0].name; - items = this.next().read_use_declarations(type === null); - this.expect("}") && this.next(); - } - result = result(name, type, items); - this.expect(";") && this.next(); - return result; - }, - /** - * Reads a use declaration - * ```ebnf - * use_declaration ::= use_type? namespace_name use_alias - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L380 - * @return {UseItem} - */ - read_use_declaration: function(typed) { - const result = this.node("useitem"); - let type = null; - if (typed) type = this.read_use_type(); - const name = this.read_namespace_name(); - const alias = this.read_use_alias(); - return result(name.name, alias, type); - }, - /** - * Reads a list of use declarations - * ```ebnf - * use_declarations ::= use_declaration (',' use_declaration)* - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L380 - * @return {UseItem[]} - */ - read_use_declarations: function(typed) { - const result = [this.read_use_declaration(typed)]; - while (this.token === ",") { - result.push(this.next().read_use_declaration(typed)); - } - return result; - }, - /** - * Reads a use statement - * ```ebnf - * use_alias ::= (T_AS T_STRING)? - * ``` - * @return {String|null} - */ - read_use_alias: function() { - let result = null; - if (this.token === this.tok.T_AS) { - if (this.next().expect(this.tok.T_STRING)) { - result = this.text(); - this.next(); - } - } - return result; - }, - /** - * Reads the namespace type declaration - * ```ebnf - * use_type ::= (T_FUNCTION | T_CONST)? - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L335 - * @return {String|null} Possible values : function, const - */ - read_use_type: function() { - if (this.token === this.tok.T_FUNCTION) { - this.next(); - return this.ast.useitem.TYPE_FUNCTION; - } else if (this.token === this.tok.T_CONST) { - this.next(); - return this.ast.useitem.TYPE_CONST; - } - return null; - } -}; diff --git a/src/parser/scalar.js b/src/parser/scalar.js deleted file mode 100644 index 3fbb1f947..000000000 --- a/src/parser/scalar.js +++ /dev/null @@ -1,307 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -const specialChar = { - "\\r": "\r", - "\\n": "\n", - "\\t": "\t", - "\\v": String.fromCharCode(11), - "\\e": String.fromCharCode(27), - "\\f": String.fromCharCode(12), - "\\\\": "\\", - "\\$": "$", - '\\"': '"', - "\\'": "'" -}; - -module.exports = { - /** - * Unescape special chars - */ - resolve_special_chars: function(text, doubleQuote) { - if (!doubleQuote) { - // single quote fix - return text.replace(/\\['\\]/g, function(seq) { - return specialChar[seq]; - }); - } - return text.replace(/\\[rntvef"'\\$]/g, function(seq) { - return specialChar[seq]; - }); - }, - /** - * ```ebnf - * scalar ::= T_MAGIC_CONST - * | T_LNUMBER | T_DNUMBER - * | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE? T_END_HEREDOC - * | '"' encaps_list '"' - * | T_START_HEREDOC encaps_list T_END_HEREDOC - * | namespace_name (T_DOUBLE_COLON T_STRING)? - * ``` - */ - read_scalar: function() { - if (this.is("T_MAGIC_CONST")) { - return this.get_magic_constant(); - } else { - let value, node; - switch (this.token) { - // TEXTS - case this.tok.T_CONSTANT_ENCAPSED_STRING: { - value = this.node("string"); - const text = this.text(); - let offset = 0; - if (text[0] === "b" || text[0] === "B") { - offset = 1; - } - const isDoubleQuote = text[offset] === '"'; - this.next(); - value = value( - isDoubleQuote, - this.resolve_special_chars( - text.substring(offset + 1, text.length - 1), - isDoubleQuote - ), - offset === 1, // unicode flag - text - ); - if (this.token === this.tok.T_DOUBLE_COLON) { - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1151 - return this.read_static_getter(value); - } else { - // dirrect string - return value; - } - } - case this.tok.T_START_HEREDOC: - if (this.lexer.curCondition === "ST_NOWDOC") { - const start = this.lexer.yylloc.first_offset; - node = this.node("nowdoc"); - value = this.next().text(); - // strip the last line return char - const lastCh = value[value.length - 1]; - if (lastCh === "\n") { - if (value[value.length - 2] === "\r") { - // windows style - value = value.substring(0, value.length - 2); - } else { - // linux style - value = value.substring(0, value.length - 1); - } - } else if (lastCh === "\r") { - // mac style - value = value.substring(0, value.length - 1); - } - this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE) && this.next(); - const raw = this.lexer._input.substring( - start, - this.lexer.yylloc.last_offset - ); - node = node( - value, - raw, - this.lexer.heredoc_label, - raw[3] === '"' || raw[3] === "'" - ); - this.expect(this.tok.T_END_HEREDOC) && this.next(); - return node; - } else { - return this.next().read_encapsed_string(this.tok.T_END_HEREDOC); - } - - case '"': - return this.next().read_encapsed_string('"'); - - case 'b"': - case 'B"': { - this.next(); - this.lexer.yylloc.prev_offset -= 1; - return this.read_encapsed_string('"'); - } - - // NUMERIC - case this.tok.T_LNUMBER: // long - case this.tok.T_DNUMBER: { - // double - const result = this.node("number"); - value = this.text(); - this.next(); - return result(value, null); - } - - // ARRAYS - case this.tok.T_ARRAY: // array parser - return this.read_array(); - case "[": // short array format - return this.read_array(); - default: { - const err = this.error("SCALAR"); - // graceful mode : ignore token & return error node - this.next(); - return err; - } - } - } - }, - /** - * Handles the dereferencing - */ - read_dereferencable: function(expr) { - let result, offset; - const node = this.node("offsetlookup"); - if (this.token === "[") { - offset = this.next().read_expr(); - if (this.expect("]")) this.next(); - result = node(expr, offset); - } else if (this.token === this.tok.T_DOLLAR_OPEN_CURLY_BRACES) { - offset = this.read_encapsed_string_item(false); - result = node(expr, offset); - } - return result; - }, - /** - * Reads and extracts an encapsed item - * ```ebnf - * encapsed_string_item ::= T_ENCAPSED_AND_WHITESPACE - * | T_DOLLAR_OPEN_CURLY_BRACES expr '}' - * | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' - * | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' - * | T_CURLY_OPEN variable '}' - * | variable - * | variable '[' expr ']' - * | variable T_OBJECT_OPERATOR T_STRING - * ``` - * @return {String|Variable|Expr|Lookup} - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1219 - */ - read_encapsed_string_item: function(isDoubleQuote) { - let result = this.node(), - offset, - node, - name; - - // plain text - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1222 - if (this.token === this.tok.T_ENCAPSED_AND_WHITESPACE) { - const text = this.text(); - this.next(); - result = result( - "string", - false, - this.resolve_special_chars(text, isDoubleQuote), - false, - text - ); - } else if (this.token === this.tok.T_DOLLAR_OPEN_CURLY_BRACES) { - // dynamic variable name - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1239 - name = null; - if (this.next().token === this.tok.T_STRING_VARNAME) { - const varName = this.text(); - name = this.node("variable"); - this.next(); - // check if lookup an offset - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1243 - if (this.token === "[") { - name = name(varName, false); - node = this.node("offsetlookup"); - offset = this.next().read_expr(); - this.expect("]") && this.next(); - name = node(name, offset); - } else { - name = this.node("constref")(varName); - } - } else { - name = this.read_expr(); - } - this.expect("}") && this.next(); - result = result("variable", name, false, true); - } else if (this.token === this.tok.T_CURLY_OPEN) { - // expression - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1246 - result = this.next().read_variable(false, false, false); - if (result.kind === "variable") { - result.curly = true; - } - this.expect("}") && this.next(); - } else if (this.token === this.tok.T_VARIABLE) { - // plain variable - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1231 - result = this.read_simple_variable(false); - - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1233 - if (this.token === "[") { - node = this.node("offsetlookup"); - offset = this.next().read_encaps_var_offset(); - this.expect("]") && this.next(); - result = node(result, offset); - } - - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L1236 - if (this.token === this.tok.T_OBJECT_OPERATOR) { - node = this.node("propertylookup"); - const what = this.node("constref"); - this.next().expect(this.tok.T_STRING); - name = this.text(); - this.next(); - result = node(result, what(name)); - } - - // error / fallback - } else { - this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE); - const value = this.text(); - this.next(); - // consider it as string - result = result("string", false, value, false, value); - } - - return result; - }, - /** - * Reads an encapsed string - */ - read_encapsed_string: function(expect) { - const start = this.lexer.yylloc.prev_offset; - let node = this.node("encapsed"); - const value = []; - let type = null; - - if (expect === "`") { - type = this.ast.encapsed.TYPE_SHELL; - } else if (expect === '"') { - type = this.ast.encapsed.TYPE_STRING; - } else { - type = this.ast.encapsed.TYPE_HEREDOC; - } - - // reading encapsed parts - while (this.token !== expect && this.token !== this.EOF) { - value.push(this.read_encapsed_string_item(true)); - } - - this.expect(expect) && this.next(); - node = node( - value, - this.lexer._input.substring(start - 1, this.lexer.yylloc.first_offset), - type - ); - - if (expect === this.tok.T_END_HEREDOC) { - node.label = this.lexer.heredoc_label; - } - return node; - }, - /** - * Constant token - */ - get_magic_constant: function() { - const result = this.node("magic"); - const name = this.text(); - this.next(); - return result(name.toUpperCase(), name); - } -}; diff --git a/src/parser/statement.js b/src/parser/statement.js deleted file mode 100644 index 0fbf44d48..000000000 --- a/src/parser/statement.js +++ /dev/null @@ -1,403 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * reading a list of top statements (helper for top_statement*) - * ```ebnf - * top_statements ::= top_statement* - * ``` - */ - read_top_statements: function() { - let result = []; - while (this.token !== this.EOF && this.token !== "}") { - const statement = this.read_top_statement(); - if (statement) { - if (Array.isArray(statement)) { - result = result.concat(statement); - } else { - result.push(statement); - } - } - } - return result; - }, - /** - * reading a top statement - * ```ebnf - * top_statement ::= - * namespace | function | class - * | interface | trait - * | use_statements | const_list - * | statement - * ``` - */ - read_top_statement: function() { - switch (this.token) { - case this.tok.T_FUNCTION: - return this.read_function(false, false); - // optional flags - case this.tok.T_ABSTRACT: - case this.tok.T_FINAL: { - const flag = this.read_class_scope(); - if (this.token === this.tok.T_CLASS) { - return this.read_class(flag); - } else { - this.error(this.tok.T_CLASS); - this.next(); - return null; - } - } - case this.tok.T_CLASS: - return this.read_class([0, 0, 0]); - case this.tok.T_INTERFACE: - return this.read_interface(); - case this.tok.T_TRAIT: - return this.read_trait(); - case this.tok.T_USE: - return this.read_use_statement(); - case this.tok.T_CONST: - return this.next().read_const_list(); - case this.tok.T_NAMESPACE: - return this.read_namespace(); - case this.tok.T_HALT_COMPILER: { - const result = this.node("halt"); - if (this.next().expect("(")) this.next(); - if (this.expect(")")) this.next(); - this.expect(";"); - this.lexer.done = true; - return result(this.lexer._input.substring(this.lexer.offset)); - } - default: - return this.read_statement(); - } - }, - /** - * reads a list of simple inner statements (helper for inner_statement*) - * ```ebnf - * inner_statements ::= inner_statement* - * ``` - */ - read_inner_statements: function() { - let result = []; - while (this.token != this.EOF && this.token !== "}") { - const statement = this.read_inner_statement(); - if (statement) { - if (Array.isArray(statement)) { - result = result.concat(statement); - } else { - result.push(statement); - } - } - } - return result; - }, - /** - * Reads a list of constants declaration - * ```ebnf - * const_list ::= T_CONST T_STRING '=' expr (',' T_STRING '=' expr)* ';' - * ``` - */ - read_const_list: function() { - const result = this.read_list( - function() { - this.expect(this.tok.T_STRING); - const result = this.node("constant"); - const name = this.text(); - if (this.next().expect("=")) { - return result(name, this.next().read_expr()); - } else { - // fallback - return result(name, null); - } - }, - ",", - false - ); - this.expectEndOfStatement(); - return result; - }, - /** - * Reads a list of constants declaration - * ```ebnf - * declare_list ::= T_STRING '=' expr (',' T_STRING '=' expr)* - * ``` - * @retrurn {Object} - */ - read_declare_list: function() { - const result = {}; - while (this.token != this.EOF && this.token !== ")") { - this.expect(this.tok.T_STRING); - const name = this.text().toLowerCase(); - if (this.next().expect("=")) { - result[name] = this.next().read_expr(); - } else { - result[name] = null; - } - if (this.token !== ",") break; - this.next(); - } - return result; - }, - /** - * reads a simple inner statement - * ```ebnf - * inner_statement ::= '{' inner_statements '}' | token - * ``` - */ - read_inner_statement: function() { - switch (this.token) { - case this.tok.T_FUNCTION: - return this.read_function(false, false); - // optional flags - case this.tok.T_ABSTRACT: - case this.tok.T_FINAL: { - const flag = this.read_class_scope(); - if (this.token === this.tok.T_CLASS) { - return this.read_class(flag); - } else { - this.error(this.tok.T_CLASS); - // graceful mode : ignore token & go next - this.next(); - return null; - } - } - case this.tok.T_CLASS: - return this.read_class([0, 0, 0]); - case this.tok.T_INTERFACE: - return this.read_interface(); - case this.tok.T_TRAIT: - return this.read_trait(); - case this.tok.T_HALT_COMPILER: { - this.raiseError( - "__HALT_COMPILER() can only be used from the outermost scope" - ); - // fallback : returns a node but does not stop the parsing - let node = this.node("halt"); - this.next().expect("(") && this.next(); - this.expect(")") && this.next(); - node = node(this.lexer._input.substring(this.lexer.offset)); - this.expect(";") && this.next(); - return node; - } - default: - return this.read_statement(); - } - }, - /** - * Reads statements - */ - read_statement: function() { - let result, expr, items, current, label; - switch (this.token) { - case "{": - return this.read_code_block(false); - - case this.tok.T_IF: - return this.read_if(); - - case this.tok.T_SWITCH: - return this.read_switch(); - - case this.tok.T_FOR: - return this.next().read_for(); - - case this.tok.T_FOREACH: - return this.next().read_foreach(); - - case this.tok.T_WHILE: - return this.next().read_while(); - - case this.tok.T_DO: - return this.next().read_do(); - - case this.tok.T_COMMENT: - return this.read_comment(); - - case this.tok.T_DOC_COMMENT: - return this.read_doc_comment(); - - case this.tok.T_RETURN: - result = this.node("return"); - expr = null; - if (!this.next().is("EOS")) { - expr = this.read_expr(); - } - this.expectEndOfStatement(); - return result(expr); - - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L429 - case this.tok.T_BREAK: - case this.tok.T_CONTINUE: { - result = this.node( - this.token === this.tok.T_CONTINUE ? "continue" : "break" - ); - let level = null; - this.next(); // look ahead - if (this.token !== ";") { - level = this.read_expr(); - } - this.expectEndOfStatement(); - return result(level); - } - - case this.tok.T_GLOBAL: - result = this.node("global"); - items = this.next().read_list(this.read_simple_variable, ","); - this.expectEndOfStatement(); - return result(items); - - case this.tok.T_STATIC: - current = [this.token, this.lexer.getState()]; - result = this.node("static"); - if (this.next().token === this.tok.T_DOUBLE_COLON) { - // static keyword for a class - this.lexer.tokens.push(current); - expr = this.next().read_expr(); - this.expect(";") && this.next(); - return expr; - } - if (this.token === this.tok.T_FUNCTION) { - return this.read_function(true, [0, 1, 0]); - } - items = this.read_variable_declarations(); - this.expectEndOfStatement(); - return result(items); - - case this.tok.T_ECHO: { - result = this.node("echo"); - const text = this.text(); - const shortForm = text === " 0 - ? this.lexer._input[this.lexer.yylloc.first_offset - 1] - : null; - const fixFirstLine = prevChar === "\r" || prevChar === "\n"; - // revert back the first stripped line - if (fixFirstLine) { - if ( - prevChar === "\n" && - this.lexer.yylloc.first_offset > 1 && - this.lexer._input[this.lexer.yylloc.first_offset - 2] === "\r" - ) { - prevChar = "\r\n"; - } - } - result = this.node("inline"); - this.next(); - return result(value, fixFirstLine ? prevChar + value : value); - } - - case this.tok.T_UNSET: - result = this.node("unset"); - this.next().expect("(") && this.next(); - items = this.read_list(this.read_variable, ","); - this.expect(")") && this.next(); - this.expect(";") && this.next(); - return result(items); - - case this.tok.T_DECLARE: { - result = this.node("declare"); - const body = []; - let mode; - this.next().expect("(") && this.next(); - const what = this.read_declare_list(); - this.expect(")") && this.next(); - if (this.token === ":") { - this.next(); - while ( - this.token != this.EOF && - this.token !== this.tok.T_ENDDECLARE - ) { - // @todo : check declare_statement from php / not valid - body.push(this.read_top_statement()); - } - this.expect(this.tok.T_ENDDECLARE) && this.next(); - this.expectEndOfStatement(); - mode = this.ast.declare.MODE_SHORT; - } else if (this.token === "{") { - this.next(); - while (this.token != this.EOF && this.token !== "}") { - // @todo : check declare_statement from php / not valid - body.push(this.read_top_statement()); - } - this.expect("}") && this.next(); - mode = this.ast.declare.MODE_BLOCK; - } else { - this.expect(";") && this.next(); - mode = this.ast.declare.MODE_NONE; - } - return result(what, body, mode); - } - - case this.tok.T_TRY: - return this.read_try(); - - case this.tok.T_THROW: - result = this.node("throw"); - expr = this.next().read_expr(); - this.expectEndOfStatement(); - return result(expr); - - case ";": // ignore this (extra ponctuation) - this.next(); - return null; - - case this.tok.T_STRING: - current = [this.token, this.lexer.getState()]; - label = this.text(); - // AST : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L457 - if (this.next().token === ":") { - result = this.node("label"); - this.next(); - return result(label); - } - - // default fallback expr / T_STRING '::' (etc...) - this.lexer.tokens.push(current); - expr = this.next().read_expr(); - this.expectEndOfStatement(); - return expr; - - case this.tok.T_GOTO: - result = this.node("goto"); - label = null; - if (this.next().expect(this.tok.T_STRING)) { - label = this.text(); - this.next().expectEndOfStatement(); - } - return result(label); - - default: - // default fallback expr - expr = this.read_expr(); - this.expectEndOfStatement(expr); - return expr; - } - }, - /** - * ```ebnf - * code_block ::= '{' (inner_statements | top_statements) '}' - * ``` - */ - read_code_block: function(top) { - const result = this.node("block"); - this.expect("{") && this.next(); - const body = top - ? this.read_top_statements() - : this.read_inner_statements(); - this.expect("}") && this.next(); - return result(null, body); - } -}; diff --git a/src/parser/switch.js b/src/parser/switch.js deleted file mode 100644 index 41c69c86c..000000000 --- a/src/parser/switch.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * Reads a switch statement - * ```ebnf - * switch ::= T_SWITCH '(' expr ')' switch_case_list - * ``` - * @return {Switch} - * @see http://php.net/manual/en/control-structures.switch.php - */ - read_switch: function() { - this.expect(this.tok.T_SWITCH) && this.next(); - const result = this.node("switch"); - this.expect("(") && this.next(); - const test = this.read_expr(); - this.expect(")") && this.next(); - const shortForm = this.token === ":"; - const body = this.read_switch_case_list(); - return result(test, body, shortForm); - }, - /** - * ```ebnf - * switch_case_list ::= '{' ';'? case_list* '}' | ':' ';'? case_list* T_ENDSWITCH ';' - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L566 - */ - read_switch_case_list: function() { - // DETECT SWITCH MODE - let expect = null; - const result = this.node("block"); - const items = []; - if (this.token === "{") { - expect = "}"; - } else if (this.token === ":") { - expect = this.tok.T_ENDSWITCH; - } else { - this.expect(["{", ":"]); - } - // OPTIONNAL ';' - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L570 - if (this.next().token === ";") { - this.next(); - } - // EXTRACTING CASES - while (this.token !== this.EOF && this.token !== expect) { - items.push(this.read_case_list(expect)); - } - // CHECK END TOKEN - this.expect(expect) && this.next(); - if (expect === this.tok.T_ENDSWITCH) { - this.expectEndOfStatement(); - } - return result(null, items); - }, - /** - * ```ebnf - * case_list ::= ((T_CASE expr) | T_DEFAULT) (':' | ';') inner_statement* - * ``` - */ - read_case_list: function(stopToken) { - const result = this.node("case"); - let test = null; - let body = null; - const items = []; - if (this.token === this.tok.T_CASE) { - test = this.next().read_expr(); - } else if (this.token === this.tok.T_DEFAULT) { - // the defaut entry - no condition - this.next(); - } else { - this.expect([this.tok.T_CASE, this.tok.T_DEFAULT]); - } - this.expect([":", ";"]) && this.next(); - body = this.node("block"); - while ( - this.token != this.EOF && - this.token !== stopToken && - this.token !== this.tok.T_CASE && - this.token !== this.tok.T_DEFAULT - ) { - items.push(this.read_inner_statement()); - } - return result(test, items.length > 0 ? body(null, items) : null); - } -}; diff --git a/src/parser/try.js b/src/parser/try.js deleted file mode 100644 index 9433d84ea..000000000 --- a/src/parser/try.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * ```ebnf - * try ::= T_TRY '{' inner_statement* '}' - * ( - * T_CATCH '(' namespace_name variable ')' '{' inner_statement* '}' - * )* - * (T_FINALLY '{' inner_statement* '}')? - * ``` - * @see https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L448 - * @return {Try} - */ - read_try: function() { - this.expect(this.tok.T_TRY); - const result = this.node("try"); - let always = null; - const catches = []; - const body = this.next().read_statement(); - // https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L455 - while (this.token === this.tok.T_CATCH) { - const item = this.node("catch"); - this.next().expect("(") && this.next(); - const what = this.read_list(this.read_namespace_name, "|", false); - const variable = this.read_variable(true, false, false); - this.expect(")"); - catches.push(item(this.next().read_statement(), what, variable)); - } - if (this.token === this.tok.T_FINALLY) { - always = this.next().read_statement(); - } - return result(body, catches, always); - } -}; diff --git a/src/parser/utils.js b/src/parser/utils.js deleted file mode 100644 index 8ef78c197..000000000 --- a/src/parser/utils.js +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -module.exports = { - /** - * Reads a short form of tokens - * @param {Number} token - The ending token - * @return {Block} - */ - read_short_form: function(token) { - const body = this.node("block"); - const items = []; - if (this.expect(":")) this.next(); - while (this.token != this.EOF && this.token !== token) { - items.push(this.read_inner_statement()); - } - if (this.expect(token)) this.next(); - this.expectEndOfStatement(); - return body(null, items); - }, - - /** - * Helper : reads a list of tokens / sample : T_STRING ',' T_STRING ... - * ```ebnf - * list ::= separator? ( item separator )* item - * ``` - */ - read_list: function(item, separator, preserveFirstSeparator) { - const result = []; - - if (this.token == separator) { - if (preserveFirstSeparator) result.push(null); - this.next(); - } - - if (typeof item === "function") { - do { - result.push(item.apply(this, [])); - if (this.token != separator) { - break; - } - } while (this.next().token != this.EOF); - } else { - if (this.expect(item)) { - result.push(this.text()); - } else { - return []; - } - while (this.next().token != this.EOF) { - if (this.token != separator) break; - // trim current separator & check item - if (this.next().token != item) break; - result.push(this.text()); - } - } - return result; - }, - - /** - * Reads a list of names separated by a comma - * - * ```ebnf - * name_list ::= namespace (',' namespace)* - * ``` - * - * Sample code : - * ```php - * func()->property // chained calls - * ``` - */ - read_variable: function(read_only, encapsed, byref) { - let result; - - // check the byref flag - if (!byref && this.token === "&") { - byref = true; - this.next(); - } - - // reads the entry point - if (this.is([this.tok.T_VARIABLE, "$"])) { - result = this.read_reference_variable(encapsed, byref); - } else if ( - this.is([ - this.tok.T_NS_SEPARATOR, - this.tok.T_STRING, - this.tok.T_NAMESPACE - ]) - ) { - result = this.node(); - const name = this.read_namespace_name(); - if (this.token != this.tok.T_DOUBLE_COLON && this.token != "(") { - // @see parser.js line 130 : resolves a conflict with scalar - const literal = name.name.toLowerCase(); - if (literal === "true") { - result = result("boolean", true, name.name); - } else if (literal === "false") { - result = result("boolean", false, name.name); - } else { - // @todo null keyword ? - result = result("constref", name); - } - } else { - result = name; - } - } else if (this.token === this.tok.T_STATIC) { - result = this.node("constref"); - this.next(); - result = result("static"); - } else { - this.expect("VARIABLE"); - } - - // static mode - if (this.token === this.tok.T_DOUBLE_COLON) { - result = this.read_static_getter(result, encapsed); - } - - return this.recursive_variable_chain_scan(result, read_only, encapsed); - }, - - // resolves a static call - read_static_getter: function(what, encapsed) { - const result = this.node("staticlookup"); - let offset, name; - if (this.next().is([this.tok.T_VARIABLE, "$"])) { - offset = this.read_reference_variable(encapsed, false); - } else if ( - this.token === this.tok.T_STRING || - this.token === this.tok.T_CLASS || - (this.php7 && this.is("IDENTIFIER")) - ) { - offset = this.node("constref"); - name = this.text(); - this.next(); - offset = offset(name); - } else { - this.error([this.tok.T_VARIABLE, this.tok.T_STRING]); - // graceful mode : set getter as error node and continue - offset = this.node("constref"); - name = this.text(); - this.next(); - offset = offset(name); - } - return result(what, offset); - }, - - recursive_variable_chain_scan: function(result, read_only, encapsed) { - let name, node, offset; - recursive_scan_loop: while (this.token != this.EOF) { - switch (this.token) { - case "(": - if (read_only) { - // @fixme : add more informations & test - return result; - } else { - result = this.node("call")( - result, - this.read_function_argument_list() - ); - } - break; - case "[": - node = this.node("offsetlookup"); - this.next(); - offset = false; - if (encapsed) { - offset = this.read_encaps_var_offset(); - this.expect("]") && this.next(); - } else { - // callable_variable : https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L1122 - if (this.token !== "]") { - offset = this.read_expr(); - this.expect("]") && this.next(); - } else { - this.next(); - } - } - result = node(result, offset); - break; - case this.tok.T_DOUBLE_COLON: - // @see https://github.com/glayzzle/php-parser/issues/107#issuecomment-354104574 - if (result.kind === "staticlookup") { - this.error(); - } - - node = this.node("staticlookup"); - if ( - this.next().token === this.tok.T_STRING || - (this.php7 && this.is("IDENTIFIER")) - ) { - offset = this.node("constref"); - name = this.text(); - this.next(); - offset = offset(name); - - if (this.token === this.tok.T_OBJECT_OPERATOR) { - this.error(); - } - } else { - this.error(this.tok.T_STRING); - // fallback on a constref node - offset = this.node("constref")(this.text()); - this.next(); - } - result = node(result, offset); - break; - case this.tok.T_OBJECT_OPERATOR: { - node = this.node("propertylookup"); - let what = null; - switch (this.next().token) { - case this.tok.T_STRING: - what = this.node("constref"); - name = this.text(); - this.next(); - what = what(name); - if (this.token === this.tok.T_VARIABLE) { - const inner = this.node("variable"); - name = this.text().substring(1); - this.next(); - what = this.node("encapsed")( - [what, inner(name, false, false)], - null, - "offset" - ); - if (what.loc && what.value[0].loc) { - what.loc.start = what.value[0].loc.start; - } - } else if (this.token === "{") { - const expr = this.next().read_expr(); - this.expect("}") && this.next(); - what = this.node("encapsed")([what, expr], null, "offset"); - if (what.loc && what.value[0].loc) { - what.loc.start = what.value[0].loc.start; - } - } - break; - case this.tok.T_VARIABLE: - what = this.node("variable"); - name = this.text().substring(1); - this.next(); - what = what(name, false, false); - break; - case "$": - this.next().expect(["{", this.tok.T_VARIABLE]); - if (this.token === "{") { - // $obj->${$varname} - what = this.next().read_expr(); - this.expect("}") && this.next(); - } else { - // $obj->$$varname - what = this.read_expr(); - } - break; - case "{": - what = this.next().read_expr(); - this.expect("}") && this.next(); - break; - default: - this.error([this.tok.T_STRING, this.tok.T_VARIABLE]); - // graceful mode : set what as error mode & continue - what = this.node("constref"); - name = this.text(); - this.next(); - what = what(name); - break; - } - result = node(result, what); - break; - } - default: - break recursive_scan_loop; - } - } - return result; - }, - /** - * https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L1231 - */ - read_encaps_var_offset: function() { - let offset = this.node(); - if (this.token === this.tok.T_STRING) { - const text = this.text(); - this.next(); - offset = offset("constref", text); - } else if (this.token === this.tok.T_NUM_STRING) { - const num = this.text(); - this.next(); - offset = offset("number", num, null); - } else if (this.token === this.tok.T_VARIABLE) { - const name = this.text().substring(1); - this.next(); - offset = offset("variable", name, false, false); - } else { - this.expect([ - this.tok.T_STRING, - this.tok.T_NUM_STRING, - this.tok.T_VARIABLE - ]); - // fallback : consider as constref - const text = this.text(); - this.next(); - offset = offset("constref", text); - } - return offset; - }, - /** - * ```ebnf - * reference_variable ::= simple_variable ('[' OFFSET ']')* | '{' EXPR '}' - * ``` - * - * $foo[123]; // foo is an array ==> gets its entry - * $foo{1}; // foo is a string ==> get the 2nd char offset - * ${'foo'}[123]; // get the dynamic var $foo - * $foo[123]{1}; // gets the 2nd char from the 123 array entry - * - */ - read_reference_variable: function(encapsed, byref) { - let result = this.read_simple_variable(byref); - let offset; - while (this.token != this.EOF) { - const node = this.node(); - if (this.token == "[") { - offset = null; - if (encapsed) { - offset = this.next().read_encaps_var_offset(); - } else { - offset = this.next().token === "]" ? null : this.read_dim_offset(); - } - this.expect("]") && this.next(); - result = node("offsetlookup", result, offset); - } else if (this.token == "{" && !encapsed) { - offset = this.next().read_expr(); - this.expect("}") && this.next(); - result = node("offsetlookup", result, offset); - } else break; - } - return result; - }, - /** - * ```ebnf - * simple_variable ::= T_VARIABLE | '$' '{' expr '}' | '$' simple_variable - * ``` - */ - read_simple_variable: function(byref) { - let result = this.node("variable"); - let name; - if ( - this.expect([this.tok.T_VARIABLE, "$"]) && - this.token === this.tok.T_VARIABLE - ) { - // plain variable name - name = this.text().substring(1); - this.next(); - result = result(name, byref, false); - } else { - if (this.token === "$") this.next(); - // dynamic variable name - switch (this.token) { - case "{": { - const expr = this.next().read_expr(); - this.expect("}") && this.next(); - result = result(expr, byref, true); - break; - } - case "$": // $$$var - result = result(this.read_simple_variable(false), byref); - break; - case this.tok.T_VARIABLE: { - // $$var - name = this.text().substring(1); - const node = this.node("variable"); - this.next(); - result = result(node(name, false, false), byref, false); - break; - } - default: - this.error(["{", "$", this.tok.T_VARIABLE]); - // graceful mode - name = this.text(); - this.next(); - result = result(name, byref, false); - } - } - return result; - } -}; diff --git a/src/tokens.js b/src/tokens.js deleted file mode 100644 index d4ccadd3b..000000000 --- a/src/tokens.js +++ /dev/null @@ -1,283 +0,0 @@ -/** - * Copyright (C) 2018 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ -"use strict"; - -/** - * PHP AST Tokens - * @type {Object} - */ -module.exports = { - values: { - 101: "T_HALT_COMPILER", - 102: "T_USE", - 103: "T_ENCAPSED_AND_WHITESPACE", - 104: "T_OBJECT_OPERATOR", - 105: "T_STRING", - 106: "T_DOLLAR_OPEN_CURLY_BRACES", - 107: "T_STRING_VARNAME", - 108: "T_CURLY_OPEN", - 109: "T_NUM_STRING", - 110: "T_ISSET", - 111: "T_EMPTY", - 112: "T_INCLUDE", - 113: "T_INCLUDE_ONCE", - 114: "T_EVAL", - 115: "T_REQUIRE", - 116: "T_REQUIRE_ONCE", - 117: "T_NAMESPACE", - 118: "T_NS_SEPARATOR", - 119: "T_AS", - 120: "T_IF", - 121: "T_ENDIF", - 122: "T_WHILE", - 123: "T_DO", - 124: "T_FOR", - 125: "T_SWITCH", - 126: "T_BREAK", - 127: "T_CONTINUE", - 128: "T_RETURN", - 129: "T_GLOBAL", - 130: "T_STATIC", - 131: "T_ECHO", - 132: "T_INLINE_HTML", - 133: "T_UNSET", - 134: "T_FOREACH", - 135: "T_DECLARE", - 136: "T_TRY", - 137: "T_THROW", - 138: "T_GOTO", - 139: "T_FINALLY", - 140: "T_CATCH", - 141: "T_ENDDECLARE", - 142: "T_LIST", - 143: "T_CLONE", - 144: "T_PLUS_EQUAL", - 145: "T_MINUS_EQUAL", - 146: "T_MUL_EQUAL", - 147: "T_DIV_EQUAL", - 148: "T_CONCAT_EQUAL", - 149: "T_MOD_EQUAL", - 150: "T_AND_EQUAL", - 151: "T_OR_EQUAL", - 152: "T_XOR_EQUAL", - 153: "T_SL_EQUAL", - 154: "T_SR_EQUAL", - 155: "T_INC", - 156: "T_DEC", - 157: "T_BOOLEAN_OR", - 158: "T_BOOLEAN_AND", - 159: "T_LOGICAL_OR", - 160: "T_LOGICAL_AND", - 161: "T_LOGICAL_XOR", - 162: "T_SL", - 163: "T_SR", - 164: "T_IS_IDENTICAL", - 165: "T_IS_NOT_IDENTICAL", - 166: "T_IS_EQUAL", - 167: "T_IS_NOT_EQUAL", - 168: "T_IS_SMALLER_OR_EQUAL", - 169: "T_IS_GREATER_OR_EQUAL", - 170: "T_INSTANCEOF", - 171: "T_INT_CAST", - 172: "T_DOUBLE_CAST", - 173: "T_STRING_CAST", - 174: "T_ARRAY_CAST", - 175: "T_OBJECT_CAST", - 176: "T_BOOL_CAST", - 177: "T_UNSET_CAST", - 178: "T_EXIT", - 179: "T_PRINT", - 180: "T_YIELD", - 181: "T_YIELD_FROM", - 182: "T_FUNCTION", - 183: "T_DOUBLE_ARROW", - 184: "T_DOUBLE_COLON", - 185: "T_ARRAY", - 186: "T_CALLABLE", - 187: "T_CLASS", - 188: "T_ABSTRACT", - 189: "T_TRAIT", - 190: "T_FINAL", - 191: "T_EXTENDS", - 192: "T_INTERFACE", - 193: "T_IMPLEMENTS", - 194: "T_VAR", - 195: "T_PUBLIC", - 196: "T_PROTECTED", - 197: "T_PRIVATE", - 198: "T_CONST", - 199: "T_NEW", - 200: "T_INSTEADOF", - 201: "T_ELSEIF", - 202: "T_ELSE", - 203: "T_ENDSWITCH", - 204: "T_CASE", - 205: "T_DEFAULT", - 206: "T_ENDFOR", - 207: "T_ENDFOREACH", - 208: "T_ENDWHILE", - 209: "T_CONSTANT_ENCAPSED_STRING", - 210: "T_LNUMBER", - 211: "T_DNUMBER", - 212: "T_LINE", - 213: "T_FILE", - 214: "T_DIR", - 215: "T_TRAIT_C", - 216: "T_METHOD_C", - 217: "T_FUNC_C", - 218: "T_NS_C", - 219: "T_START_HEREDOC", - 220: "T_END_HEREDOC", - 221: "T_CLASS_C", - 222: "T_VARIABLE", - 223: "T_OPEN_TAG", - 224: "T_OPEN_TAG_WITH_ECHO", - 225: "T_CLOSE_TAG", - 226: "T_WHITESPACE", - 227: "T_COMMENT", - 228: "T_DOC_COMMENT", - 229: "T_ELLIPSIS", - 230: "T_COALESCE", - 231: "T_POW", - 232: "T_POW_EQUAL", - 233: "T_SPACESHIP" - }, - names: { - T_HALT_COMPILER: 101, - T_USE: 102, - T_ENCAPSED_AND_WHITESPACE: 103, - T_OBJECT_OPERATOR: 104, - T_STRING: 105, - T_DOLLAR_OPEN_CURLY_BRACES: 106, - T_STRING_VARNAME: 107, - T_CURLY_OPEN: 108, - T_NUM_STRING: 109, - T_ISSET: 110, - T_EMPTY: 111, - T_INCLUDE: 112, - T_INCLUDE_ONCE: 113, - T_EVAL: 114, - T_REQUIRE: 115, - T_REQUIRE_ONCE: 116, - T_NAMESPACE: 117, - T_NS_SEPARATOR: 118, - T_AS: 119, - T_IF: 120, - T_ENDIF: 121, - T_WHILE: 122, - T_DO: 123, - T_FOR: 124, - T_SWITCH: 125, - T_BREAK: 126, - T_CONTINUE: 127, - T_RETURN: 128, - T_GLOBAL: 129, - T_STATIC: 130, - T_ECHO: 131, - T_INLINE_HTML: 132, - T_UNSET: 133, - T_FOREACH: 134, - T_DECLARE: 135, - T_TRY: 136, - T_THROW: 137, - T_GOTO: 138, - T_FINALLY: 139, - T_CATCH: 140, - T_ENDDECLARE: 141, - T_LIST: 142, - T_CLONE: 143, - T_PLUS_EQUAL: 144, - T_MINUS_EQUAL: 145, - T_MUL_EQUAL: 146, - T_DIV_EQUAL: 147, - T_CONCAT_EQUAL: 148, - T_MOD_EQUAL: 149, - T_AND_EQUAL: 150, - T_OR_EQUAL: 151, - T_XOR_EQUAL: 152, - T_SL_EQUAL: 153, - T_SR_EQUAL: 154, - T_INC: 155, - T_DEC: 156, - T_BOOLEAN_OR: 157, - T_BOOLEAN_AND: 158, - T_LOGICAL_OR: 159, - T_LOGICAL_AND: 160, - T_LOGICAL_XOR: 161, - T_SL: 162, - T_SR: 163, - T_IS_IDENTICAL: 164, - T_IS_NOT_IDENTICAL: 165, - T_IS_EQUAL: 166, - T_IS_NOT_EQUAL: 167, - T_IS_SMALLER_OR_EQUAL: 168, - T_IS_GREATER_OR_EQUAL: 169, - T_INSTANCEOF: 170, - T_INT_CAST: 171, - T_DOUBLE_CAST: 172, - T_STRING_CAST: 173, - T_ARRAY_CAST: 174, - T_OBJECT_CAST: 175, - T_BOOL_CAST: 176, - T_UNSET_CAST: 177, - T_EXIT: 178, - T_PRINT: 179, - T_YIELD: 180, - T_YIELD_FROM: 181, - T_FUNCTION: 182, - T_DOUBLE_ARROW: 183, - T_DOUBLE_COLON: 184, - T_ARRAY: 185, - T_CALLABLE: 186, - T_CLASS: 187, - T_ABSTRACT: 188, - T_TRAIT: 189, - T_FINAL: 190, - T_EXTENDS: 191, - T_INTERFACE: 192, - T_IMPLEMENTS: 193, - T_VAR: 194, - T_PUBLIC: 195, - T_PROTECTED: 196, - T_PRIVATE: 197, - T_CONST: 198, - T_NEW: 199, - T_INSTEADOF: 200, - T_ELSEIF: 201, - T_ELSE: 202, - T_ENDSWITCH: 203, - T_CASE: 204, - T_DEFAULT: 205, - T_ENDFOR: 206, - T_ENDFOREACH: 207, - T_ENDWHILE: 208, - T_CONSTANT_ENCAPSED_STRING: 209, - T_LNUMBER: 210, - T_DNUMBER: 211, - T_LINE: 212, - T_FILE: 213, - T_DIR: 214, - T_TRAIT_C: 215, - T_METHOD_C: 216, - T_FUNC_C: 217, - T_NS_C: 218, - T_START_HEREDOC: 219, - T_END_HEREDOC: 220, - T_CLASS_C: 221, - T_VARIABLE: 222, - T_OPEN_TAG: 223, - T_OPEN_TAG_WITH_ECHO: 224, - T_CLOSE_TAG: 225, - T_WHITESPACE: 226, - T_COMMENT: 227, - T_DOC_COMMENT: 228, - T_ELLIPSIS: 229, - T_COALESCE: 230, - T_POW: 231, - T_POW_EQUAL: 232, - T_SPACESHIP: 233 - } -}; diff --git a/styles/jsdoc-default.css b/styles/jsdoc-default.css new file mode 100644 index 000000000..f2bc6a9d7 --- /dev/null +++ b/styles/jsdoc-default.css @@ -0,0 +1,957 @@ +@font-face { + font-family: "Avenir Next W01"; + font-style: normal; + font-weight: 600; + src: url("https://fast.fonts.net/dv2/14/14c73713-e4df-4dba-933b-057feeac8dd1.woff2?d44f19a684109620e484167ba790e8180fd9e29df91d80ce3d096f014db863074e1ea706cf5ed4e1c042492e76df291ce1d24ec684d3d9da9684f55406b9f22bce02f0f30f556681593dafea074d7bd44e28a680d083ccfd44ed4f8a3087a20c56147c11f917ed1dbd85c4a18cf38da25e6ac78f008f472262304d50e7e0cb7541ef1642c676db6e4bde4924846f5daf486fbde9335e98f6a20f6664bc4525253d1d4fca42cf1c490483c8daf0237f6a0fd292563417ad80ca3e69321417747bdc6f0969f34b2a0401b5e2b9a4dfd5b06d9710850900c66b34870aef&projectId=f750d5c7-baa2-4767-afd7-45484f47fe17") format('woff2'); +} + +@font-face { + font-family: "Avenir Next W01"; + font-style: normal; + font-weight: 500; + src: url("https://fast.fonts.net/dv2/14/627fbb5a-3bae-4cd9-b617-2f923e29d55e.woff2?d44f19a684109620e484167ba790e8180fd9e29df91d80ce3d096f014db863074e1ea706cf5ed4e1c042492e76df291ce1d24ec684d3d9da9684f55406b9f22bce02f0f30f556681593dafea074d7bd44e28a680d083ccfd44ed4f8a3087a20c56147c11f917ed1dbd85c4a18cf38da25e6ac78f008f472262304d50e7e0cb7541ef1642c676db6e4bde4924846f5daf486fbde9335e98f6a20f6664bc4525253d1d4fca42cf1c490483c8daf0237f6a0fd292563417ad80ca3e69321417747bdc6f0969f34b2a0401b5e2b9a4dfd5b06d9710850900c66b34870aef&projectId=f750d5c7-baa2-4767-afd7-45484f47fe17") format('woff2'); +} + +@font-face { + font-family: "Avenir Next W01"; + font-style: normal; + font-weight: 400; + src: url("https://fast.fonts.net/dv2/14/2cd55546-ec00-4af9-aeca-4a3cd186da53.woff2?d44f19a684109620e484167ba790e8180fd9e29df91d80ce3d096f014db863074e1ea706cf5ed4e1c042492e76df291ce1d24ec684d3d9da9684f55406b9f22bce02f0f30f556681593dafea074d7bd44e28a680d083ccfd44ed4f8a3087a20c56147c11f917ed1dbd85c4a18cf38da25e6ac78f008f472262304d50e7e0cb7541ef1642c676db6e4bde4924846f5daf486fbde9335e98f6a20f6664bc4525253d1d4fca42cf1c490483c8daf0237f6a0fd292563417ad80ca3e69321417747bdc6f0969f34b2a0401b5e2b9a4dfd5b06d9710850900c66b34870aef&projectId=f750d5c7-baa2-4767-afd7-45484f47fe17") format('woff2'); +} + +@font-face { + font-family: 'bt_mono'; + font-style: normal; + font-weight: 400; + src: url('https://assets.braintreegateway.com/fonts/bt_mono_regular-webfont.eot'); + src: url('https://assets.braintreegateway.com/fonts/bt_mono_regular-webfont.woff2') format('woff2'), url('https://assets.braintreegateway.com/fonts/bt_mono_regular-webfont.woff') format('woff'), url('https://assets.braintreegateway.com/fonts/bt_mono_regular-webfont.ttf') format('truetype'), url('https://assets.braintreegateway.com/fonts/bt_mono_regular-webfont.svg#bt_mono_reqular-webfont') format('svg'); +} + +@font-face { + font-family: 'bt_mono'; + font-style: normal; + font-weight: 500; + src: url('https://assets.braintreegateway.com/fonts/bt_mono_medium-webfont.eot'); + src: url('https://assets.braintreegateway.com/fonts/bt_mono_medium-webfont.woff2') format('woff2'), url('https://assets.braintreegateway.com/fonts/bt_mono_medium-webfont.woff') format('woff'), url('https://assets.braintreegateway.com/fonts/bt_mono_medium-webfont.ttf') format('truetype'), url('https://assets.braintreegateway.com/fonts/bt_mono_medium-webfont.svg#bt_mono_medium-webfont') format('svg'); +} + +@font-face { + font-family: 'bt_mono'; + font-style: normal; + font-weight: 600; + src: url('https://assets.braintreegateway.com/fonts/bt_mono_bold-webfont.eot'); + src: url('https://assets.braintreegateway.com/fonts/bt_mono_bold-webfont.woff2') format('woff2'), url('https://assets.braintreegateway.com/fonts/bt_mono_bold-webfont.woff') format('woff'), url('https://assets.braintreegateway.com/fonts/bt_mono_bold-webfont.ttf') format('truetype'), url('https://assets.braintreegateway.com/fonts/bt_mono_bold-webfont.svg#bt_mono_bold-webfont') format('svg'); +} + +@font-face { + font-family: 'bt_mono'; + font-style: normal; + font-weight: 900; + src: url('https://assets.braintreegateway.com/fonts/bt_mono_heavy-webfont.eot'); + src: url('https://assets.braintreegateway.com/fonts/bt_mono_heavy-webfont.woff2') format('woff2'), url('https://assets.braintreegateway.com/fonts/bt_mono_heavy-webfont.woff') format('woff'), url('https://assets.braintreegateway.com/fonts/bt_mono_heavy-webfont.ttf') format('truetype'), url('https://assets.braintreegateway.com/fonts/bt_mono_heavy-webfont.svg#bt_mono_heavy-webfont') format('svg'); +} + +* { + box-sizing: border-box +} + +html, body { + height: 100%; + width: 100%; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + color: #3e3c42; + text-rendering: optimizeLegibility; + margin: 0; +} + +body { + color: #3e3c42; + background-color: #f3f3f3; + width: 100%; + font: 16px/1.875 "Avenir Next W01", "Avenir Next", "Helvetica Neue", Helvetica, sans-serif; + font-size: 16px; + line-height: 160%; +} + +a, a:active { + color: #0095dd; + text-decoration: none; +} + +a:hover { + text-decoration: underline +} + +p, ul, ol, blockquote { + margin-bottom: 1em; +} + +p { + max-width: 800px; +} + +h1, h2, h3, h4, h5, h6 { + color: #706d77; + font-weight: 500; + margin: 0; + line-height: 1; +} + +h1 { + color: #4b484f; + font-weight: 500; + font-size: 40px; + display: block; +} + +h1 span { + color: #999; + font-size: 32px; + display: block; + line-height: 1.5; +} + +h1.page-title { + border-bottom: 1px dashed #ccc; + margin-bottom: 20px; + padding-bottom: 30px; +} + +h2 { + font-size: 30px; + margin: 1.5em 0 0; +} + +h3 { + font-size: 20px; + margin: 1.5em 0 0; + text-transform: uppercase; +} + +h3.reference-title { + display: block; + font-weight: 400; + margin-top: 2em; + max-width: 200px; +} + +h3.reference-title small { + display: inline-block; + color: #0095dd; + margin-left: 5px; + font-weight: 500; +} + +h3.subsection-title { + border-bottom: 1px solid #ececec; + padding-bottom: 20px; + margin-top: 3em; + margin-bottom: 1em; +} + +h4 { + font-size: 16px; + margin: 1em 0 0; + font-weight: bold; +} + +h4.name { + font-size: 20px; + margin-top: 0; + font-weight: 500; +} + +h5 { + margin: 2em 0 0.5em 0; + font-size: 14px; + font-weight: 500; + text-transform: uppercase; +} + +.container-overview .subsection-title { + font-size: 14px; + text-transform: uppercase; + margin: 8px 0 15px 0; + font-weight: bold; + color: #4D4E53; + padding-top: 10px; +} + +h6 { + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; + text-transform: uppercase; + font-weight: 500; +} + +tt, code, kbd, samp { + font-family: "Source Code Pro", monospace; + background: #f4f4f4; + padding: 1px 5px; + border-radius: 5px; +} + +.class-description { + margin-bottom: 1em; + margin-top: 1em; + padding: 10px 20px; + background-color: rgba(26, 159, 224, 0.1); +} + +.class-description:empty { + margin: 0 +} + +#main { + background-color: white; + float: right; + min-width: 360px; + width: calc(100% - 300px); + padding: 30px; + z-index: 100; +} + +header { + display: block; + max-width: 1400px; +} + +section { + display: block; + max-width: 1400px; + background-color: #fff; +} + +.variation { + display: none +} + +.signature-attributes { + font-size: 60%; + color: #aaa; + font-style: italic; + font-weight: lighter; +} + +.rule { + width: 100%; + margin-top: 20px; + display: block; + border-top: 1px solid #ccc; +} + +ul { + list-style-type: none; + padding-left: 0; +} + +ul li a { + font-weight: 500; +} + +ul ul { + padding-top: 5px; +} + +ul li ul { + padding-left: 20px; +} + +ul li ul li a { + font-weight: normal; +} + +nav { + float: left; + display: block; + width: 300px; + background: #f7f7f7; + overflow-x: visible; + overflow-y: auto; + height: 100%; + padding: 0px 30px 100px 30px; + height: 100%; + position: fixed; + transition: left 0.2s; + z-index: 998; + margin-top: 0px; + top: 43px; +} + +.navicon-button { + display: inline-block; + position: fixed; + bottom: 1.5em; + right: 1.5em; + z-index: 2; +} + +nav h3 { + font-size: 13px; + text-transform: uppercase; + letter-spacing: 1px; + font-weight: bold; + line-height: 24px; + margin: 40px 0 10px 0; + padding: 0; +} + +nav ul { + font-size: 100%; + line-height: 17px; + padding: 0; + margin: 0; + list-style-type: none; + border: none; + padding-left: 0; +} + +nav ul a { + font-size: 16px; +} + +nav ul a, nav ul a:active { + display: block; +} + +nav ul a:hover, nav ul a:active { + color: hsl(200, 100%, 43%); + text-decoration: none; +} + +nav>ul { + padding: 0 10px; +} + +nav>ul li:first-child { + padding-top: 0; +} + +nav ul li ul { + padding-left: 0; +} + +nav>ul>li { + border-bottom: 1px solid #e2e2e2; + padding: 10px 0 20px 0; +} + +nav>ul>li.active ul { + border-left: 3px solid #0095dd; + padding-left: 15px; +} + +nav>ul>li.active ul li.active a { + font-weight: bold; +} + +nav>ul>li.active a { + color: #0095dd; +} + +nav>ul>li>a { + color: #706d77; + padding: 20px 0; + font-size: 18px; +} + +nav ul ul { + margin-bottom: 10px padding-left: 0; +} + +nav ul ul a { + color: #5f5c63; +} + +nav ul ul a, nav ul ul a:active { + font-family: 'bt_mono', monospace; + font-size: 14px; + padding-left: 20px; + padding-top: 3px; + padding-bottom: 9px; +} + +nav h2 { + font-size: 12px; + margin: 0; + padding: 0; +} + +nav>h2>a { + color: hsl(202, 71%, 50%); + border-bottom: 1px solid hsl(202, 71%, 50%); + padding-bottom: 5px; +} + +nav>h2>a:hover { + font-weight: 500; + text-decoration: none; +} + +footer { + background-color: #fff; + color: hsl(0, 0%, 28%); + margin-left: 300px; + display: block; + font-style: italic; + font-size: 12px; + padding: 30px; + text-align: center; +} + +.ancestors { + color: #999; +} + +.ancestors a { + color: #999 !important; + text-decoration: none; +} + +.clear { + clear: both; +} + +.important { + font-weight: bold; + color: #950B02; +} + +.yes-def { + text-indent: -1000px; +} + +.type-signature { + color: #aaa; +} + +.name, .signature { + font-family: 'bt_mono', monospace; + word-wrap: break-word; +} + +.details { + margin-top: 14px; + font-size: 13px; + text-align: right; + background: #ffffff; + /* Old browsers */ + background: -moz-linear-gradient(left, #ffffff 0%, #fafafa 100%); + /* FF3.6-15 */ + background: -webkit-linear-gradient(left, #ffffff 0%, #fafafa 100%); + /* Chrome10-25,Safari5.1-6 */ + background: linear-gradient(to right, #ffffff 0%, #fafafa 100%); + /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fafafa', GradientType=1); + padding-right: 5px; +} + +.details dt { + display: inline-block; +} + +.details dd { + display: inline-block; + margin: 0; +} + +.details dd a { + font-style: italic; + font-weight: normal; + line-height: 1; +} + +.details ul { + margin: 0 +} + +.details ul { + list-style-type: none +} + +.details li {} + +.details pre.prettyprint { + margin: 0 +} + +.details .object-value { + padding-top: 0 +} + +.description { + margin-bottom: 1em; + margin-top: 1em; +} + +.code-caption { + font-style: italic; + margin: 0; + font-size: 16px; + color: #545454; +} + +.prettyprint { + font-size: 13px; + border: 1px solid #ddd; + border-radius: 3px; + overflow: auto; + background-color: #fbfbfb; +} + +.prettyprint.source { + width: inherit; +} + +.prettyprint code { + font-size: 100%; + line-height: 18px; + display: block; + margin: 0 30px; + background-color: #fbfbfb; + color: #4D4E53; +} + +.prettyprint>code { + padding: 30px 15px; +} + +.prettyprint .linenums code { + padding: 0 15px; +} + +.prettyprint .linenums li:first-of-type code { + padding-top: 15px; +} + +.prettyprint code span.line { + display: inline-block; +} + +.prettyprint.linenums { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol { + padding-left: 0 +} + +.prettyprint.linenums li { + border-left: 3px #ddd solid +} + +.prettyprint.linenums li.selected, .prettyprint.linenums li.selected * { + background-color: lightyellow +} + +.prettyprint.linenums li * { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.readme .prettyprint { + max-width: 800px; +} + +.params, .props { + border-spacing: 0; + border: 1px solid #ddd; + border-radius: 3px; + width: 100%; + font-size: 14px; +} + +.params .name, .props .name, .name code { + color: #4D4E53; + font-family: 'bt_mono', monospace; + font-size: 100%; +} + +.params td, .params th, .props td, .props th { + margin: 0px; + text-align: left; + vertical-align: top; + padding: 10px; + display: table-cell; +} + +.params td { + border-top: 1px solid #eee; +} + +.params thead tr, .props thead tr { + background-color: #fff; + font-weight: bold; +} + +.params .params thead tr, .props .props thead tr { + background-color: #fff; + font-weight: bold; +} + +.params td.description>p:first-child, .props td.description>p:first-child { + margin-top: 0; + padding-top: 0; +} + +.params td.description>p:last-child, .props td.description>p:last-child { + margin-bottom: 0; + padding-bottom: 0; +} + +dl.param-type { + margin-top: 5px; +} + +.param-type dt, .param-type dd { + display: inline-block +} + +.param-type dd { + font-family: Consolas, Monaco, 'Andale Mono', monospace +} + +.disabled { + color: #454545 +} + + +/* tag source style */ + +.tag-deprecated { + padding-right: 5px; +} + +.tag-source { + border-bottom: 1px solid rgba(28, 160, 224, 0.35); +} + +.tag-source:first-child { + border-bottom: 1px solid rgba(28, 160, 224, 1); +} + + +/* navicon button */ + +.navicon-button { + position: relative; + transition: 0.25s; + cursor: pointer; + user-select: none; + opacity: .8; + background-color: white; + border-radius: 100%; + width: 50px; + height: 50px; + -webkit-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.31); + -moz-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.31); + box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.31); +} + +.navicon-button .navicon:before, .navicon-button .navicon:after { + transition: 0.25s; +} + +.navicon-button:hover { + transition: 0.5s; + opacity: 1; +} + +.navicon-button:hover .navicon:before, .navicon-button:hover .navicon:after { + transition: 0.25s; +} + +.navicon-button:hover .navicon:before { + top: .425rem; +} + +.navicon-button:hover .navicon:after { + top: -.425rem; +} + + +/* navicon */ + +.navicon { + position: relative; + width: 1.5em; + height: .195rem; + background: #000; + top: calc(50% - .09rem); + left: calc(50% - .75rem); + transition: 0.3s; + border-radius: 5px; +} + +.navicon:before, .navicon:after { + display: block; + content: ""; + height: .195rem; + width: 1.5rem; + background: #000; + position: absolute; + z-index: -1; + transition: 0.3s 0.25s; +} + +.navicon:before { + top: 0.425rem; + height: .195rem; + border-radius: 5px; +} + +.navicon:after { + top: -0.425rem; + border-radius: 5px; +} + + +/* open */ + +.nav-trigger:checked+label:not(.steps) .navicon:before, .nav-trigger:checked+label:not(.steps) .navicon:after { + top: 0 !important; +} + +.nav-trigger:checked+label .navicon:before, .nav-trigger:checked+label .navicon:after { + transition: 0.5s; +} + + +/* Minus */ + +.nav-trigger:checked+label { + transform: scale(0.75); +} + + +/* × and + */ + +.nav-trigger:checked+label.plus .navicon, .nav-trigger:checked+label.x .navicon { + background: transparent; +} + +.nav-trigger:checked+label.plus .navicon:before, .nav-trigger:checked+label.x .navicon:before { + transform: rotate(-45deg); + background: #000; +} + +.nav-trigger:checked+label.plus .navicon:after, .nav-trigger:checked+label.x .navicon:after { + transform: rotate(45deg); + background: #000; +} + +.nav-trigger:checked+label.plus { + transform: scale(0.75) rotate(45deg); +} + +.nav-trigger:checked~nav { + left: 0 !important; +} + +.nav-trigger:checked~.overlay { + display: block; +} + +.nav-trigger { + position: fixed; + top: 0; + clip: rect(0, 0, 0, 0); +} + +.overlay { + display: none; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + width: 100%; + height: 100%; + background: hsla(0, 0%, 0%, 0.5); + z-index: 1; +} + +table { + border-collapse: separate; + ; + display: block; + overflow-x: auto; + /*table-layout:fixed;*/ +} + +table tbody td { + border-top: 1px solid hsl(207, 10%, 86%); + border-right: 1px solid #eee; + padding: 5px; + /*word-wrap: break-word;*/ +} + +td table.params, td table.props { + border: 0; +} + +@media only screen and (min-width: 320px) and (max-width: 680px) { + body { + overflow-x: hidden; + } + #main { + padding: 30px 30px; + width: 100%; + min-width: 360px; + } + nav { + background: #FFF; + width: 300px; + height: 100%; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: -300px; + z-index: 3; + padding: 0 10px; + transition: left 0.2s; + margin-top: 0; + } + .navicon-button { + display: inline-block; + position: fixed; + bottom: 1.5em; + right: 20px; + z-index: 1000; + } + .top-nav-wrapper { + display: none; + } + #main h1.page-title { + margin: 0.5em 0; + } + footer { + margin-left: 0; + margin-bottom: 30px; + } +} + +.top-nav-wrapper { + background-color: #ececec; + position: fixed; + top: 0px; + left: 0px; + padding: 10px 10px 0 10px; + z-index: 999; + width: 300px; +} + +.top-nav-wrapper ul { + margin: 0; +} + +.top-nav-wrapper ul li { + display: inline-block; + padding: 0 10px; + vertical-align: top; +} + +.top-nav-wrapper ul li.active { + border-bottom: 2px solid rgba(28, 160, 224, 1); +} + +.search-wrapper { + display: inline-block; + position: relative; +} + +.search-wrapper svg { + position: absolute; + left: 0px; +} + +input.search-input { + background: transparent; + box-shadow: 0; + border: 0; + border-bottom: 1px solid #c7c7c7; + padding: 7px 15px 12px 35px; + margin: 0 auto; +} + + +/* Smooth outline with box-shadow: */ + +input.search-input:focus { + border-bottom: 2px solid rgba(28, 160, 224, 1); + outline: none; +} + + +/* Hightlight JS Paradiso Light Theme */ + +.hljs-comment, .hljs-quote { + color: #776e71 +} + +.hljs-variable, .hljs-template-variable, .hljs-tag, .hljs-name, .hljs-selector-id, .hljs-selector-class, .hljs-regexp, .hljs-link, .hljs-meta { + color: #ef6155 +} + +.hljs-number, .hljs-built_in, .hljs-builtin-name, .hljs-literal, .hljs-type, .hljs-params, .hljs-deletion { + color: #f99b15 +} + +.hljs-title, .hljs-section, .hljs-attribute { + color: #fec418 +} + +.hljs-string, .hljs-symbol, .hljs-bullet, .hljs-addition { + color: #48b685 +} + +.hljs-keyword, .hljs-selector-tag { + color: #815ba4 +} + +.hljs { + display: block; + overflow-x: auto; + background: #e7e9db; + color: #4f424c; + padding: 0.5em +} + +.hljs-emphasis { + font-style: italic +} + +.hljs-strong { + font-weight: bold +} + +.link-icon { + opacity: 0; + position: absolute; + margin-left: -25px; + padding-right: 5px; + padding-top: 2px; +} + +.example-container .link-icon { + margin-top: -6px; +} + +.example-container:hover .link-icon, +.name-container:hover .link-icon { + opacity: .5; +} + +.name-container { + display: flex; + padding-top: 1em; +} diff --git a/styles/prettify-jsdoc.css b/styles/prettify-jsdoc.css new file mode 100644 index 000000000..834a866d4 --- /dev/null +++ b/styles/prettify-jsdoc.css @@ -0,0 +1,111 @@ +/* JSDoc prettify.js theme */ + +/* plain text */ +.pln { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* string content */ +.str { + color: hsl(104, 100%, 24%); + font-weight: normal; + font-style: normal; +} + +/* a keyword */ +.kwd { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a comment */ +.com { + font-weight: normal; + font-style: italic; +} + +/* a type name */ +.typ { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a literal value */ +.lit { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* punctuation */ +.pun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp open bracket */ +.opn { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp close bracket */ +.clo { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a markup tag name */ +.tag { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute name */ +.atn { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute value */ +.atv { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a declaration */ +.dec { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a variable name */ +.var { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a function name */ +.fun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} diff --git a/styles/prettify-tomorrow.css b/styles/prettify-tomorrow.css new file mode 100644 index 000000000..eaf125103 --- /dev/null +++ b/styles/prettify-tomorrow.css @@ -0,0 +1,138 @@ +/* Tomorrow Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* Pretty printing styles. Used with prettify.js. */ +/* SPAN elements with the classes below are added by prettyprint. */ +/* plain text */ +.pln { + color: #4d4d4c; } + +@media screen { + /* string content */ + .str { + color: hsl(104, 100%, 24%); } + + /* a keyword */ + .kwd { + color: hsl(240, 100%, 50%); } + + /* a comment */ + .com { + color: hsl(0, 0%, 60%); } + + /* a type name */ + .typ { + color: hsl(240, 100%, 32%); } + + /* a literal value */ + .lit { + color: hsl(240, 100%, 40%); } + + /* punctuation */ + .pun { + color: #000000; } + + /* lisp open bracket */ + .opn { + color: #000000; } + + /* lisp close bracket */ + .clo { + color: #000000; } + + /* a markup tag name */ + .tag { + color: #c82829; } + + /* a markup attribute name */ + .atn { + color: #f5871f; } + + /* a markup attribute value */ + .atv { + color: #3e999f; } + + /* a declaration */ + .dec { + color: #f5871f; } + + /* a variable name */ + .var { + color: #c82829; } + + /* a function name */ + .fun { + color: #4271ae; } } +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { + color: #060; } + + .kwd { + color: #006; + font-weight: bold; } + + .com { + color: #600; + font-style: italic; } + + .typ { + color: #404; + font-weight: bold; } + + .lit { + color: #044; } + + .pun, .opn, .clo { + color: #440; } + + .tag { + color: #006; + font-weight: bold; } + + .atn { + color: #404; } + + .atv { + color: #060; } } +/* Style */ +/* +pre.prettyprint { + background: white; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 12px; + line-height: 1.5; + border: 1px solid #ccc; + padding: 10px; } +*/ + +/* Get LI elements to show when they are in the main article */ +article ul li { + list-style-type: circle; + margin-left: 25px; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; } + +/* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + /* */ } + +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { + /* */ } diff --git a/test/location.test.js b/test/location.test.js deleted file mode 100644 index 0b25597e4..000000000 --- a/test/location.test.js +++ /dev/null @@ -1,140 +0,0 @@ -var parser = require("./main"); - -describe("Test offsets", function() { - // init a new parser instance - var test = parser.create({ - ast: { - withPositions: true, - withSource: true - }, - parser: { - extractDoc: true - // debug: true - }, - lexer: { - // debug: true - } - }); - - var lines = ["// a comment", 'echo "string";', "$a = true;"]; - var text = lines.join("\r\n"); - var ast = test.parseEval(text); - - describe("to program node", function() { - it("test line", function() { - expect(ast.loc.start.line).toBe(1); - expect(ast.loc.end.line).toBe(lines.length); - }); - it("test column", function() { - expect(ast.loc.start.column).toBe(0); - expect(ast.loc.end.column).toBe(lines[lines.length - 1].length); - }); - it("test offsets", function() { - expect(ast.loc.start.offset).toBe(0); - expect(ast.loc.end.offset).toBe(text.length); - }); - }); - - describe("to comment node", function() { - it("test line", function() { - expect(ast.comments[0].loc.start.line).toBe(1); - expect(ast.comments[0].loc.end.line).toBe(2); - }); - it("test column", function() { - expect(ast.comments[0].loc.start.column).toBe(0); - expect(ast.comments[0].loc.end.column).toBe(0); - }); - it("test offsets", function() { - expect(ast.comments[0].loc.start.offset).toBe(0); - expect(ast.comments[0].loc.end.offset).toBe(lines[0].length + 2); - expect(ast.comments[0].loc.source).toBe(lines[0] + '\r\n'); - }); - }); - - describe("on echo node", function() { - it("test line", function() { - expect(ast.children[0].loc.start.line).toBe(2); - expect(ast.children[0].loc.end.line).toBe(2); - }); - it("test column", function() { - expect(ast.children[0].loc.start.column).toBe(0); - expect(ast.children[0].loc.end.column).toBe(14); - }); - it("test offsets", function() { - expect(ast.children[0].loc.start.offset).toBe(14); - expect(ast.children[0].loc.end.offset).toBe(28); - expect(ast.children[0].loc.source).toBe(lines[1]); - }); - }); - - describe("on text node", function() { - const arg = ast.children[0].arguments[0]; - it("test line", function() { - expect(arg.loc.start.line).toBe(2); - expect(arg.loc.end.line).toBe(2); - }); - it("test column", function() { - expect(arg.loc.start.column).toBe(5); - expect(arg.loc.end.column).toBe(13); - }); - it("test offsets", function() { - expect(arg.loc.source).toBe('"string"'); - }); - }); - - describe("on assign node", function() { - it("test line", function() { - expect(ast.children[1].loc.start.line).toBe(3); - expect(ast.children[1].loc.end.line).toBe(3); - }); - it("test column", function() { - expect(ast.children[1].loc.start.column).toBe(0); - // ignored ';' because it was eaten by expr and assign - // was retrieved by expr_item without it - expect(ast.children[1].loc.end.column).toBe(10); - }); - it("test offsets", function() { - expect(ast.children[1].loc.source).toBe(lines[2].substring(0, 10)); - }); - }); - - describe("on variable node", function() { - const node = ast.children[1].left; - it("test line", function() { - expect(node.loc.start.line).toBe(3); - expect(node.loc.end.line).toBe(3); - }); - it("test column", function() { - expect(node.loc.start.column).toBe(0); - expect(node.loc.end.column).toBe(2); - }); - it("test offsets", function() { - expect(node.loc.source).toBe("$a"); - }); - }); - - describe("on boolean node", function() { - const node = ast.children[1].right; - it("test line", function() { - expect(node.loc.start.line).toBe(3); - expect(node.loc.end.line).toBe(3); - }); - it("test column", function() { - expect(node.loc.start.column).toBe(5); - expect(node.loc.end.column).toBe(9); - }); - it("test offsets", function() { - expect(node.loc.source).toBe("true"); - }); - }); - - describe("test block statements", function() { - it("test if", function() { - const ast = test.parseEval('if(true) {}\n//foo\necho $bar;'); - expect(ast.children[0].loc.start.line).toBe(1); - expect(ast.children[0].loc.end.line).toBe(1); - expect(ast.children[1].loc.start.line).toBe(3); - expect(ast.children[1].loc.end.line).toBe(3); - }); - }) -}); diff --git a/test/main.js b/test/main.js deleted file mode 100644 index 79f165adc..000000000 --- a/test/main.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * Defines a list of helpers for tests - * Copyright (C) 2017 Glayzzle (BSD3 License) - * @authors https://github.com/glayzzle/php-parser/graphs/contributors - * @url http://glayzzle.com - */ - -var parser = require("../src/index"); -// @todo : move here the debug code -// @todo : add an automated token check (with php7) -module.exports = parser; diff --git a/test/perf.test.js b/test/perf.test.js deleted file mode 100644 index 66945efa0..000000000 --- a/test/perf.test.js +++ /dev/null @@ -1,117 +0,0 @@ -var parser = require("./main"); - -describe("Performance tests", function() { - var code = ` - 1000) { - speed = speed / 1000; - if (speed > 1000) { - speed = speed / 1000; - speed = Math.round(speed * 100) / 100 + "M"; - } else { - speed = Math.round(speed * 100) / 100 + "K"; - } - } - console.log(" + Tokens speed => " + speed + "/sec"); - - speed = 1000 / duration * (code.length * iter); - // speed.should.be.greaterThan(10e5 * 2 * 0.8); - - if (speed > 1024) { - speed = speed / 1024; - if (speed > 1024) { - speed = speed / 1024; - speed = Math.round(speed * 100) / 100 + "M"; - } else { - speed = Math.round(speed * 100) / 100 + "K"; - } - } - console.log(" + Reading speed => " + speed + "/sec"); - }); - - it("parser", function() { - var reader = new parser(); - var nodeSize = 0; - var countNode = function(node) { - nodeSize++; - for (var k in node) { - if (node[k]) { - if (node[k].kind) { - countNode(node[k]); - } else if (Array.isArray(node[k])) { - for (var i = 0; i < node[k].length; i++) { - if (node[k][i] && node[k][i].kind) { - countNode(node[k][i]); - } - } - } - } - } - }; - countNode(reader.parseCode(code)); - - var hrTime = process.hrtime(); - var iter = 100; - var start = hrTime[0] * 1000000 + hrTime[1] / 1000; - for (var i = 0; i < iter; i++) { - reader.parseCode(code); - } - hrTime = process.hrtime(); - var end = hrTime[0] * 1000000 + hrTime[1] / 1000; - var duration = (end - start) / 1000; // in MS - var speed = 1000 / duration * (nodeSize * iter); - // speed.should.be.greaterThan(10e4); - - if (speed > 1000) { - speed = speed / 1000; - if (speed > 1000) { - speed = speed / 1000; - speed = Math.round(speed * 100) / 100 + "M"; - } else { - speed = Math.round(speed * 100) / 100 + "K"; - } - } - console.log(" + Nodes speed => " + speed + "/sec"); - - speed = 1000 / duration * (code.length * iter); - // speed.should.be.greaterThan(10e5 * 1 * 0.8); - - if (speed > 1024) { - speed = speed / 1024; - if (speed > 1024) { - speed = speed / 1024; - speed = Math.round(speed * 100) / 100 + "M"; - } else { - speed = Math.round(speed * 100) / 100 + "K"; - } - } - console.log(" + Overall speed => " + speed + "/sec"); - }); -}); diff --git a/test/precedence.test.js b/test/precedence.test.js deleted file mode 100644 index d093edee3..000000000 --- a/test/precedence.test.js +++ /dev/null @@ -1,122 +0,0 @@ -var parser = require("./main"); - -/** - * Check precedence by using parenthesis on node B - */ -var checkPrecedence = function(a, b) { - if (!a || !b) - return false; - for (var k in b) { - if (k === 'parenthesizedExpression') continue; - if (b.hasOwnProperty(k)) { - if (!a.hasOwnProperty(k)) - return false; - if (typeof b[k] === "object") { - checkPrecedence(a[k], b[k]); - } else { - expect(a[k]).toEqual(b[k]); - } - } - } - return true; -}; - -var shouldBeSame = function(a, b) { - var ast = parser.parseEval([ - a + ";", - b + ";" - ].join("\n")); - let result = checkPrecedence(ast.children[0], ast.children[1]); - if (!result) { - console.log("Parsed :", ast.children[0]); - console.log("Expected :", ast.children[1]); - } - expect(result).toBeTruthy(); -}; - -// START TESTS HERE -describe("Test precedence", function() { - it("test *", function() { - shouldBeSame("5 * 3 - 2", "(5 * 3) - 2"); - shouldBeSame("2 - 5 * 3", "2 - (5 * 3)"); - }); - it("test /", function() { - shouldBeSame("5 / 3 + 2", "(5 / 3) + 2"); - shouldBeSame("5 + 3 / 2", "5 + (3 / 2)"); - }); - it("test %", function() { - shouldBeSame("5 % 3 . 2", "(5 % 3) . 2"); - }); - it("test instanceof", function() { - shouldBeSame("3 instanceof 2 * 5", "(3 instanceof 2) * 5"); - }); - it("test <<", function() { - shouldBeSame("1 + 3 << 5", "(1 + 3) << 5"); - }); - it("test ==", function() { - shouldBeSame("1 + 5 == 3", "(1 + 5 ) == 3"); - }); - it("test &", function() { - shouldBeSame("1 == 2 & 3", "(1 == 2) & 3"); - }); - it("test ^", function() { - shouldBeSame("1 & 2 ^ 3", "(1 & 2) ^ 3"); - }); - it("test |", function() { - shouldBeSame("1 ^ 2 | 3", "(1 ^ 2) | 3"); - }); - it("test &&", function() { - shouldBeSame("1 | 2 && 3", "(1 | 2) && 3"); - }); - it("test ||", function() { - shouldBeSame("1 && 2 || 3", "(1 && 2) || 3"); - }); - it("test ??", function() { - shouldBeSame("1 || 2 ?? 3", "(1 || 2) ?? 3"); - }); - it("test ?:", function() { - shouldBeSame("1 ?? 2 ? 3 : 5", "(1 ?? 2) ? 3 : 5"); - shouldBeSame("1 and 2 ? 3 : 5", "1 and (2 ? 3 : 5)"); - }); - it("test =", function() { - shouldBeSame("5 + $a = 1", "5 + ($a = 1)"); - shouldBeSame("5 XOR $a += 1", "5 XOR ($a += 1)"); - }); - it("test OR", function() { - shouldBeSame("5 XOR 4 OR 3", "(5 XOR 4) OR 3"); - shouldBeSame("5 OR 4 XOR 3", "5 OR (4 XOR 3)"); - }); - it("test XOR", function() { - shouldBeSame("5 AND 4 XOR 3", "(5 AND 4) XOR 3"); - shouldBeSame("5 XOR 4 AND 3", "5 XOR (4 AND 3)"); - }); - it("test AND", function() { - shouldBeSame("5 + 4 AND 3", "(5 + 4) AND 3"); - shouldBeSame("5 AND 4 + 3", "5 AND (4 + 3)"); - }); - it("test unary : !", function() { - shouldBeSame("!4 instanceof 3", "(!4) instanceof 3"); - shouldBeSame("!4 + 5 instanceof 3", "(!4) + (5 instanceof 3)"); - shouldBeSame("6 + !4 + 5", "6 + (!4) + 5"); - shouldBeSame("if($a && !$b) {}", "if($a && (!$b)) {}"); - }); - it("test concat", function() { - shouldBeSame('"a"."b"."c"."d"', '((("a"."b")."c")."d")'); - }); - it("test retif", function() { - shouldBeSame("$a ? 1 : $b ? 2 : $c ? 3 : 4", "(($a ? 1 : $b) ? 2 : $c) ? 3 : 4"); - }); - it("test + / *", function() { - shouldBeSame("1 + 2 * 3", "1 + (2 * 3)"); - }); - // https://github.com/glayzzle/php-parser/issues/81 - it("test assign with and", function() { - shouldBeSame("$a and $b = $c and $d", "($a and ($b = $c)) and $d"); - }); - it("test assign list", function() { - shouldBeSame("$a = $b = $c", "($a = ($b = $c))"); - }); - it("test assign with &&", function() { - shouldBeSame("$a && $b = $c && $d", "$a && ($b = ($c && $d))"); - }); -}); diff --git a/test/snapshot/__snapshots__/acid.test.js.snap b/test/snapshot/__snapshots__/acid.test.js.snap deleted file mode 100644 index 66bd2f2db..000000000 --- a/test/snapshot/__snapshots__/acid.test.js.snap +++ /dev/null @@ -1,7334 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Acid level 1 1`] = ` -Program { - "children": Array [ - Inline { - "kind": "inline", - "loc": Location { - "end": Position { - "column": 0, - "line": 2, - "offset": 15, - }, - "source": "#!/usr/bin/php -", - "start": Position { - "column": 0, - "line": 1, - "offset": 0, - }, - }, - "raw": "#!/usr/bin/php -", - "value": "#!/usr/bin/php -", - }, - Echo { - "arguments": Array [ - Call { - "arguments": Array [], - "kind": "call", - "loc": Location { - "end": Position { - "column": 17, - "line": 2, - "offset": 32, - }, - "source": "()", - "start": Position { - "column": 15, - "line": 2, - "offset": 30, - }, - }, - "what": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 15, - "line": 2, - "offset": 30, - }, - "source": "php_version", - "start": Position { - "column": 4, - "line": 2, - "offset": 19, - }, - }, - "name": "php_version", - "resolution": "uqn", - }, - }, - ], - "kind": "echo", - "loc": Location { - "end": Position { - "column": 18, - "line": 2, - "offset": 33, - }, - "source": " 'achoum', - 'bashful' => 'tadah' - ]", - "start": Position { - "column": 14, - "line": 32, - "offset": 577, - }, - }, - "name": "dwarf", - "value": Array { - "items": Array [ - Entry { - "key": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 14, - "line": 33, - "offset": 602, - }, - "source": "'sneezy'", - "start": Position { - "column": 6, - "line": 33, - "offset": 594, - }, - }, - "raw": "'sneezy'", - "unicode": false, - "value": "sneezy", - }, - "kind": "entry", - "loc": Location { - "end": Position { - "column": 26, - "line": 33, - "offset": 614, - }, - "source": "'sneezy' => 'achoum'", - "start": Position { - "column": 6, - "line": 33, - "offset": 594, - }, - }, - "value": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 26, - "line": 33, - "offset": 614, - }, - "source": "'achoum'", - "start": Position { - "column": 18, - "line": 33, - "offset": 606, - }, - }, - "raw": "'achoum'", - "unicode": false, - "value": "achoum", - }, - }, - Entry { - "key": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 15, - "line": 34, - "offset": 631, - }, - "source": "'bashful'", - "start": Position { - "column": 6, - "line": 34, - "offset": 622, - }, - }, - "raw": "'bashful'", - "unicode": false, - "value": "bashful", - }, - "kind": "entry", - "loc": Location { - "end": Position { - "column": 26, - "line": 34, - "offset": 642, - }, - "source": "'bashful' => 'tadah'", - "start": Position { - "column": 6, - "line": 34, - "offset": 622, - }, - }, - "value": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 26, - "line": 34, - "offset": 642, - }, - "source": "'tadah'", - "start": Position { - "column": 19, - "line": 34, - "offset": 635, - }, - }, - "raw": "'tadah'", - "unicode": false, - "value": "tadah", - }, - }, - ], - "kind": "array", - "loc": Location { - "end": Position { - "column": 5, - "line": 35, - "offset": 648, - }, - "source": "[ - 'sneezy' => 'achoum', - 'bashful' => 'tadah' - ]", - "start": Position { - "column": 23, - "line": 32, - "offset": 586, - }, - }, - "shortForm": true, - }, - "visibility": "protected", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [ - Foreach { - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "loc": Location { - "end": Position { - "column": 40, - "line": 42, - "offset": 855, - }, - "source": "Hey ho $name, $greeting !\\"", - "start": Position { - "column": 14, - "line": 42, - "offset": 829, - }, - }, - "raw": "\\"Hey ho $name, $greeting !\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 21, - "line": 42, - "offset": 836, - }, - "source": "Hey ho ", - "start": Position { - "column": 14, - "line": 42, - "offset": 829, - }, - }, - "raw": "Hey ho ", - "unicode": false, - "value": "Hey ho ", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 26, - "line": 42, - "offset": 841, - }, - "source": "$name", - "start": Position { - "column": 21, - "line": 42, - "offset": 836, - }, - }, - "name": "name", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 28, - "line": 42, - "offset": 843, - }, - "source": ", ", - "start": Position { - "column": 26, - "line": 42, - "offset": 841, - }, - }, - "raw": ", ", - "unicode": false, - "value": ", ", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 37, - "line": 42, - "offset": 852, - }, - "source": "$greeting", - "start": Position { - "column": 28, - "line": 42, - "offset": 843, - }, - }, - "name": "greeting", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 39, - "line": 42, - "offset": 854, - }, - "source": " !", - "start": Position { - "column": 37, - "line": 42, - "offset": 852, - }, - }, - "raw": " !", - "unicode": false, - "value": " !", - }, - ], - }, - ], - "kind": "echo", - "loc": Location { - "end": Position { - "column": 41, - "line": 42, - "offset": 856, - }, - "source": "echo \\"Hey ho $name, $greeting !\\";", - "start": Position { - "column": 8, - "line": 42, - "offset": 823, - }, - }, - "shortForm": false, - }, - Continue { - "kind": "continue", - "level": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 21, - "line": 43, - "offset": 878, - }, - "source": "$foo", - "start": Position { - "column": 17, - "line": 43, - "offset": 874, - }, - }, - "name": "foo", - }, - "loc": Location { - "end": Position { - "column": 22, - "line": 43, - "offset": 879, - }, - "source": "continue $foo;", - "start": Position { - "column": 8, - "line": 43, - "offset": 865, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 7, - "line": 44, - "offset": 887, - }, - "source": "{ - echo \\"Hey ho $name, $greeting !\\"; - continue $foo; - }", - "start": Position { - "column": 50, - "line": 41, - "offset": 813, - }, - }, - }, - "key": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 35, - "line": 41, - "offset": 798, - }, - "source": "$name", - "start": Position { - "column": 30, - "line": 41, - "offset": 793, - }, - }, - "name": "name", - }, - "kind": "foreach", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "loc": Location { - "end": Position { - "column": 0, - "line": 41, - "offset": 763, - }, - "source": "// do not wanna do -", - "start": Position { - "column": 6, - "line": 40, - "offset": 744, - }, - }, - "value": "// do not wanna do -", - }, - ], - "loc": Location { - "end": Position { - "column": 7, - "line": 44, - "offset": 887, - }, - "source": "($this->dwarf as $name => $greeting) { - echo \\"Hey ho $name, $greeting !\\"; - continue $foo; - }", - "start": Position { - "column": 13, - "line": 41, - "offset": 776, - }, - }, - "shortForm": false, - "source": PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 26, - "line": 41, - "offset": 789, - }, - "source": "->dwarf", - "start": Position { - "column": 19, - "line": 41, - "offset": 782, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 26, - "line": 41, - "offset": 789, - }, - "source": "dwarf", - "start": Position { - "column": 21, - "line": 41, - "offset": 784, - }, - }, - "name": "dwarf", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 19, - "line": 41, - "offset": 782, - }, - "source": "$this", - "start": Position { - "column": 14, - "line": 41, - "offset": 777, - }, - }, - "name": "this", - }, - }, - "value": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 48, - "line": 41, - "offset": 811, - }, - "source": "$greeting", - "start": Position { - "column": 39, - "line": 41, - "offset": 802, - }, - }, - "name": "greeting", - }, - }, - Throw { - "kind": "throw", - "loc": Location { - "end": Position { - "column": 40, - "line": 45, - "offset": 928, - }, - "source": "throw new \\\\ComeToHome('Thats it');", - "start": Position { - "column": 6, - "line": 45, - "offset": 894, - }, - }, - "what": New { - "arguments": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 38, - "line": 45, - "offset": 926, - }, - "source": "'Thats it'", - "start": Position { - "column": 28, - "line": 45, - "offset": 916, - }, - }, - "raw": "'Thats it'", - "unicode": false, - "value": "Thats it", - }, - ], - "kind": "new", - "loc": Location { - "end": Position { - "column": 39, - "line": 45, - "offset": 927, - }, - "source": "\\\\ComeToHome('Thats it')", - "start": Position { - "column": 16, - "line": 45, - "offset": 904, - }, - }, - "what": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 27, - "line": 45, - "offset": 915, - }, - "source": "\\\\ComeToHome", - "start": Position { - "column": 16, - "line": 45, - "offset": 904, - }, - }, - "name": "\\\\ComeToHome", - "resolution": "qn", - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 5, - "line": 46, - "offset": 934, - }, - "source": "{ - // do not wanna do - foreach($this->dwarf as $name => $greeting) { - echo \\"Hey ho $name, $greeting !\\"; - continue $foo; - } - throw new \\\\ComeToHome('Thats it'); - }", - "start": Position { - "column": 40, - "line": 39, - "offset": 736, - }, - }, - }, - "byref": false, - "isAbstract": false, - "isFinal": true, - "isStatic": false, - "kind": "method", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "loc": Location { - "end": Position { - "column": 7, - "line": 38, - "offset": 695, - }, - "source": "/** - * Something is done here - */", - "start": Position { - "column": 4, - "line": 36, - "offset": 654, - }, - }, - "value": "/** - * Something is done here - */", - }, - ], - "loc": Location { - "end": Position { - "column": 5, - "line": 46, - "offset": 934, - }, - "source": "function doSomething()", - "start": Position { - "column": 17, - "line": 39, - "offset": 713, - }, - }, - "name": "doSomething", - "nullable": false, - "type": null, - "visibility": "public", - }, - ], - "extends": null, - "implements": Array [ - Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 51, - "line": 25, - "offset": 439, - }, - "source": "namespace\\\\fooBaz", - "start": Position { - "column": 35, - "line": 25, - "offset": 423, - }, - }, - "name": "fooBaz", - "resolution": "rn", - }, - ], - "isAbstract": true, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "loc": Location { - "end": Position { - "column": 5, - "line": 24, - "offset": 387, - }, - "source": "/** - * a class - */", - "start": Position { - "column": 2, - "line": 22, - "offset": 365, - }, - }, - "value": "/** - * a class - */", - }, - ], - "loc": Location { - "end": Position { - "column": 3, - "line": 47, - "offset": 938, - }, - "source": "class fooBar implements namespace\\\\fooBaz { - use Line; - use foo, bar { - foo::baz insteadof bar; - bar::foo as baz; - } - const FOOBAR = 'BARFOO'; - protected $dwarf = [ - 'sneezy' => 'achoum', - 'bashful' => 'tadah' - ]; - /** - * Something is done here - */ - final public function doSomething() { - // do not wanna do - foreach($this->dwarf as $name => $greeting) { - echo \\"Hey ho $name, $greeting !\\"; - continue $foo; - } - throw new \\\\ComeToHome('Thats it'); - } - }", - "start": Position { - "column": 11, - "line": 25, - "offset": 399, - }, - }, - "name": "fooBar", - }, - Interface { - "body": Array [ - Method { - "arguments": Array [], - "body": null, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "loc": Location { - "end": Position { - "column": 39, - "line": 50, - "offset": 1014, - }, - "source": "function Am_I_Uggly() : bool", - "start": Position { - "column": 11, - "line": 50, - "offset": 986, - }, - }, - "name": "Am_I_Uggly", - "nullable": false, - "type": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 39, - "line": 50, - "offset": 1014, - }, - "source": "bool", - "start": Position { - "column": 35, - "line": 50, - "offset": 1010, - }, - }, - "name": "bool", - "resolution": "uqn", - }, - "visibility": "public", - }, - Method { - "arguments": Array [], - "body": null, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "loc": Location { - "end": Position { - "column": 38, - "line": 51, - "offset": 1054, - }, - "source": "function broken() : bool", - "start": Position { - "column": 14, - "line": 51, - "offset": 1030, - }, - }, - "name": "broken", - "nullable": false, - "type": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 38, - "line": 51, - "offset": 1054, - }, - "source": "bool", - "start": Position { - "column": 34, - "line": 51, - "offset": 1050, - }, - }, - "name": "bool", - "resolution": "uqn", - }, - "visibility": "protected", - }, - Method { - "arguments": Array [], - "body": null, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": true, - "kind": "method", - "loc": Location { - "end": Position { - "column": 55, - "line": 52, - "offset": 1111, - }, - "source": "function isWhiteSnowAlive() : bool", - "start": Position { - "column": 21, - "line": 52, - "offset": 1077, - }, - }, - "name": "isWhiteSnowAlive", - "nullable": false, - "type": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 55, - "line": 52, - "offset": 1111, - }, - "source": "bool", - "start": Position { - "column": 51, - "line": 52, - "offset": 1107, - }, - }, - "name": "bool", - "resolution": "uqn", - }, - "visibility": "protected", - }, - ], - "extends": Array [ - Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 32, - "line": 49, - "offset": 972, - }, - "source": "Object", - "start": Position { - "column": 26, - "line": 49, - "offset": 966, - }, - }, - "name": "Object", - "resolution": "uqn", - }, - ], - "kind": "interface", - "loc": Location { - "end": Position { - "column": 3, - "line": 53, - "offset": 1116, - }, - "source": "interface Miror extends Object { - public function Am_I_Uggly() : bool; - protected function broken() : bool; - static protected function isWhiteSnowAlive() : bool; - }", - "start": Position { - "column": 2, - "line": 49, - "offset": 942, - }, - }, - "name": "Miror", - }, - _Function { - "arguments": Array [], - "body": Block { - "children": Array [ - Yield { - "key": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 16, - "line": 56, - "offset": 1154, - }, - "source": "'ator'", - "start": Position { - "column": 10, - "line": 56, - "offset": 1148, - }, - }, - "raw": "'ator'", - "unicode": false, - "value": "ator", - }, - "kind": "yield", - "loc": Location { - "end": Position { - "column": 25, - "line": 56, - "offset": 1163, - }, - "source": "yield 'ator' => $foo;", - "start": Position { - "column": 4, - "line": 56, - "offset": 1142, - }, - }, - "value": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 24, - "line": 56, - "offset": 1162, - }, - "source": "$foo", - "start": Position { - "column": 20, - "line": 56, - "offset": 1158, - }, - }, - "name": "foo", - }, - }, - YieldFrom { - "kind": "yieldfrom", - "loc": Location { - "end": Position { - "column": 24, - "line": 57, - "offset": 1188, - }, - "source": "yield from iter(50);", - "start": Position { - "column": 4, - "line": 57, - "offset": 1168, - }, - }, - "value": Call { - "arguments": Array [ - Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 22, - "line": 57, - "offset": 1186, - }, - "source": "50", - "start": Position { - "column": 20, - "line": 57, - "offset": 1184, - }, - }, - "value": "50", - }, - ], - "kind": "call", - "loc": Location { - "end": Position { - "column": 23, - "line": 57, - "offset": 1187, - }, - "source": "(50)", - "start": Position { - "column": 19, - "line": 57, - "offset": 1183, - }, - }, - "what": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 19, - "line": 57, - "offset": 1183, - }, - "source": "iter", - "start": Position { - "column": 15, - "line": 57, - "offset": 1179, - }, - }, - "name": "iter", - "resolution": "uqn", - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 3, - "line": 58, - "offset": 1192, - }, - "source": "{ - yield 'ator' => $foo; - yield from iter(50); - }", - "start": Position { - "column": 18, - "line": 55, - "offset": 1136, - }, - }, - }, - "byref": false, - "kind": "function", - "loc": Location { - "end": Position { - "column": 3, - "line": 58, - "offset": 1192, - }, - "source": "function iter()", - "start": Position { - "column": 2, - "line": 55, - "offset": 1120, - }, - }, - "name": "iter", - "nullable": false, - "type": null, - }, - Trait { - "body": Array [ - Method { - "arguments": Array [ - Parameter { - "byref": false, - "kind": "parameter", - "loc": Location { - "end": Position { - "column": 44, - "line": 61, - "offset": 1253, - }, - "source": "bool $arrow = false", - "start": Position { - "column": 25, - "line": 61, - "offset": 1234, - }, - }, - "name": "arrow", - "nullable": false, - "type": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 29, - "line": 61, - "offset": 1238, - }, - "source": "bool", - "start": Position { - "column": 25, - "line": 61, - "offset": 1234, - }, - }, - "name": "bool", - "resolution": "uqn", - }, - "value": Boolean { - "kind": "boolean", - "loc": Location { - "end": Position { - "column": 44, - "line": 61, - "offset": 1253, - }, - "source": "false", - "start": Position { - "column": 39, - "line": 61, - "offset": 1248, - }, - }, - "raw": "false", - "value": false, - }, - "variadic": false, - }, - ], - "body": Block { - "children": Array [ - Switch { - "body": Block { - "children": Array [ - Case { - "body": null, - "kind": "case", - "loc": Location { - "end": Position { - "column": 19, - "line": 63, - "offset": 1314, - }, - "source": "case 'dot':", - "start": Position { - "column": 8, - "line": 63, - "offset": 1303, - }, - }, - "test": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 18, - "line": 63, - "offset": 1313, - }, - "source": "'dot'", - "start": Position { - "column": 13, - "line": 63, - "offset": 1308, - }, - }, - "raw": "'dot'", - "unicode": false, - "value": "dot", - }, - }, - Case { - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 15, - "line": 65, - "offset": 1352, - }, - "source": "$body", - "start": Position { - "column": 10, - "line": 65, - "offset": 1347, - }, - }, - "name": "body", - }, - "loc": Location { - "end": Position { - "column": 27, - "line": 65, - "offset": 1364, - }, - "source": "$body = '......';", - "start": Position { - "column": 10, - "line": 65, - "offset": 1347, - }, - }, - "operator": "=", - "right": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 26, - "line": 65, - "offset": 1363, - }, - "source": "'......'", - "start": Position { - "column": 18, - "line": 65, - "offset": 1355, - }, - }, - "raw": "'......'", - "unicode": false, - "value": "......", - }, - }, - Break { - "kind": "break", - "level": null, - "loc": Location { - "end": Position { - "column": 16, - "line": 66, - "offset": 1381, - }, - "source": "break;", - "start": Position { - "column": 10, - "line": 66, - "offset": 1375, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 16, - "line": 66, - "offset": 1381, - }, - "source": "$body = '......'; - break;", - "start": Position { - "column": 10, - "line": 65, - "offset": 1347, - }, - }, - }, - "kind": "case", - "loc": Location { - "end": Position { - "column": 16, - "line": 66, - "offset": 1381, - }, - "source": "case 'point': - $body = '......'; - break;", - "start": Position { - "column": 8, - "line": 64, - "offset": 1323, - }, - }, - "test": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 20, - "line": 64, - "offset": 1335, - }, - "source": "'point'", - "start": Position { - "column": 13, - "line": 64, - "offset": 1328, - }, - }, - "raw": "'point'", - "unicode": false, - "value": "point", - }, - }, - Case { - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 15, - "line": 68, - "offset": 1414, - }, - "source": "$body", - "start": Position { - "column": 10, - "line": 68, - "offset": 1409, - }, - }, - "name": "body", - }, - "loc": Location { - "end": Position { - "column": 26, - "line": 68, - "offset": 1425, - }, - "source": "$body = '-----';", - "start": Position { - "column": 10, - "line": 68, - "offset": 1409, - }, - }, - "operator": "=", - "right": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 25, - "line": 68, - "offset": 1424, - }, - "source": "'-----'", - "start": Position { - "column": 18, - "line": 68, - "offset": 1417, - }, - }, - "raw": "'-----'", - "unicode": false, - "value": "-----", - }, - }, - Break { - "kind": "break", - "level": null, - "loc": Location { - "end": Position { - "column": 16, - "line": 69, - "offset": 1442, - }, - "source": "break;", - "start": Position { - "column": 10, - "line": 69, - "offset": 1436, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 16, - "line": 69, - "offset": 1442, - }, - "source": "$body = '-----'; - break;", - "start": Position { - "column": 10, - "line": 68, - "offset": 1409, - }, - }, - }, - "kind": "case", - "loc": Location { - "end": Position { - "column": 16, - "line": 69, - "offset": 1442, - }, - "source": "default: - $body = '-----'; - break;", - "start": Position { - "column": 8, - "line": 67, - "offset": 1390, - }, - }, - "test": null, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 7, - "line": 70, - "offset": 1450, - }, - "source": "{ - case 'dot': - case 'point': - $body = '......'; - break; - default: - $body = '-----'; - break; - }", - "start": Position { - "column": 27, - "line": 62, - "offset": 1293, - }, - }, - }, - "kind": "switch", - "loc": Location { - "end": Position { - "column": 7, - "line": 70, - "offset": 1450, - }, - "source": "($this->style) { - case 'dot': - case 'point': - $body = '......'; - break; - default: - $body = '-----'; - break; - }", - "start": Position { - "column": 12, - "line": 62, - "offset": 1278, - }, - }, - "shortForm": false, - "test": PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 25, - "line": 62, - "offset": 1291, - }, - "source": "->style", - "start": Position { - "column": 18, - "line": 62, - "offset": 1284, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 25, - "line": 62, - "offset": 1291, - }, - "source": "style", - "start": Position { - "column": 20, - "line": 62, - "offset": 1286, - }, - }, - "name": "style", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 18, - "line": 62, - "offset": 1284, - }, - "source": "$this", - "start": Position { - "column": 13, - "line": 62, - "offset": 1279, - }, - }, - "name": "this", - }, - }, - }, - Return { - "expr": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 18, - "line": 71, - "offset": 1469, - }, - "source": "$body", - "start": Position { - "column": 13, - "line": 71, - "offset": 1464, - }, - }, - "name": "body", - }, - "loc": Location { - "end": Position { - "column": 40, - "line": 71, - "offset": 1491, - }, - "source": "$body . ($arrow ? '>' : '')", - "start": Position { - "column": 13, - "line": 71, - "offset": 1464, - }, - }, - "right": RetIf { - "falseExpr": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 39, - "line": 71, - "offset": 1490, - }, - "source": "''", - "start": Position { - "column": 37, - "line": 71, - "offset": 1488, - }, - }, - "raw": "''", - "unicode": false, - "value": "", - }, - "kind": "retif", - "loc": Location { - "end": Position { - "column": 39, - "line": 71, - "offset": 1490, - }, - "source": "$arrow ? '>' : ''", - "start": Position { - "column": 22, - "line": 71, - "offset": 1473, - }, - }, - "parenthesizedExpression": true, - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 28, - "line": 71, - "offset": 1479, - }, - "source": "$arrow", - "start": Position { - "column": 22, - "line": 71, - "offset": 1473, - }, - }, - "name": "arrow", - }, - "trueExpr": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 34, - "line": 71, - "offset": 1485, - }, - "source": "'>'", - "start": Position { - "column": 31, - "line": 71, - "offset": 1482, - }, - }, - "raw": "'>'", - "unicode": false, - "value": ">", - }, - }, - "type": ".", - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 41, - "line": 71, - "offset": 1492, - }, - "source": "return $body . ($arrow ? '>' : '');", - "start": Position { - "column": 6, - "line": 71, - "offset": 1457, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 5, - "line": 72, - "offset": 1498, - }, - "source": "{ - switch($this->style) { - case 'dot': - case 'point': - $body = '......'; - break; - default: - $body = '-----'; - break; - } - return $body . ($arrow ? '>' : ''); - }", - "start": Position { - "column": 55, - "line": 61, - "offset": 1264, - }, - }, - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "loc": Location { - "end": Position { - "column": 5, - "line": 72, - "offset": 1498, - }, - "source": "function draw(bool $arrow = false) : string", - "start": Position { - "column": 11, - "line": 61, - "offset": 1220, - }, - }, - "name": "draw", - "nullable": false, - "type": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 54, - "line": 61, - "offset": 1263, - }, - "source": "string", - "start": Position { - "column": 48, - "line": 61, - "offset": 1257, - }, - }, - "name": "string", - "resolution": "uqn", - }, - "visibility": "public", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [ - Return { - "expr": Magic { - "kind": "magic", - "loc": Location { - "end": Position { - "column": 26, - "line": 74, - "offset": 1556, - }, - "source": "__NAMESPACE__", - "start": Position { - "column": 13, - "line": 74, - "offset": 1543, - }, - }, - "raw": "__NAMESPACE__", - "value": "__NAMESPACE__", - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 27, - "line": 74, - "offset": 1557, - }, - "source": "return __NAMESPACE__;", - "start": Position { - "column": 6, - "line": 74, - "offset": 1536, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 5, - "line": 75, - "offset": 1563, - }, - "source": "{ - return __NAMESPACE__; - }", - "start": Position { - "column": 29, - "line": 73, - "offset": 1528, - }, - }, - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "loc": Location { - "end": Position { - "column": 5, - "line": 75, - "offset": 1563, - }, - "source": "function shuut()", - "start": Position { - "column": 12, - "line": 73, - "offset": 1511, - }, - }, - "name": "shuut", - "nullable": false, - "type": null, - "visibility": "private", - }, - ], - "extends": null, - "implements": null, - "kind": "trait", - "loc": Location { - "end": Position { - "column": 3, - "line": 76, - "offset": 1567, - }, - "source": "trait Line { - public function draw(bool $arrow = false) : string { - switch($this->style) { - case 'dot': - case 'point': - $body = '......'; - break; - default: - $body = '-----'; - break; - } - return $body . ($arrow ? '>' : ''); - } - private function shuut() { - return __NAMESPACE__; - } - }", - "start": Position { - "column": 2, - "line": 60, - "offset": 1196, - }, - }, - "name": "Line", - }, - _Function { - "arguments": Array [], - "body": Block { - "children": Array [ - Global { - "items": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 20, - "line": 80, - "offset": 1640, - }, - "source": "$persians", - "start": Position { - "column": 11, - "line": 80, - "offset": 1631, - }, - }, - "name": "persians", - }, - ], - "kind": "global", - "loc": Location { - "end": Position { - "column": 21, - "line": 80, - "offset": 1641, - }, - "source": "global $persians;", - "start": Position { - "column": 4, - "line": 80, - "offset": 1624, - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 10, - "line": 82, - "offset": 1653, - }, - "source": "$index", - "start": Position { - "column": 4, - "line": 82, - "offset": 1647, - }, - }, - "name": "index", - }, - "loc": Location { - "end": Position { - "column": 16, - "line": 82, - "offset": 1659, - }, - "source": "$index = -1;", - "start": Position { - "column": 4, - "line": 82, - "offset": 1647, - }, - }, - "operator": "=", - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 14, - "line": 82, - "offset": 1657, - }, - "source": "-", - "start": Position { - "column": 13, - "line": 82, - "offset": 1656, - }, - }, - "value": "-1", - }, - }, - Label { - "kind": "label", - "loc": Location { - "end": Position { - "column": 5, - "line": 83, - "offset": 1665, - }, - "source": ":", - "start": Position { - "column": 4, - "line": 83, - "offset": 1664, - }, - }, - "name": "next", - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 8, - "line": 84, - "offset": 1674, - }, - "source": "$guy", - "start": Position { - "column": 4, - "line": 84, - "offset": 1670, - }, - }, - "name": "guy", - }, - "loc": Location { - "end": Position { - "column": 31, - "line": 84, - "offset": 1697, - }, - "source": "$guy = $persians[++$index];", - "start": Position { - "column": 4, - "line": 84, - "offset": 1670, - }, - }, - "operator": "=", - "right": OffsetLookup { - "kind": "offsetlookup", - "loc": Location { - "end": Position { - "column": 30, - "line": 84, - "offset": 1696, - }, - "source": "[++$index]", - "start": Position { - "column": 20, - "line": 84, - "offset": 1686, - }, - }, - "offset": Pre { - "kind": "pre", - "loc": Location { - "end": Position { - "column": 29, - "line": 84, - "offset": 1695, - }, - "source": "++$index", - "start": Position { - "column": 21, - "line": 84, - "offset": 1687, - }, - }, - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 29, - "line": 84, - "offset": 1695, - }, - "source": "$index", - "start": Position { - "column": 23, - "line": 84, - "offset": 1689, - }, - }, - "name": "index", - }, - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 20, - "line": 84, - "offset": 1686, - }, - "source": "$persians", - "start": Position { - "column": 11, - "line": 84, - "offset": 1677, - }, - }, - "name": "persians", - }, - }, - }, - If { - "alternate": Block { - "children": Array [ - Call { - "arguments": Array [ - variadic { - "kind": "variadic", - "loc": Location { - "end": Position { - "column": 24, - "line": 88, - "offset": 1789, - }, - "source": "...$foo", - "start": Position { - "column": 17, - "line": 88, - "offset": 1782, - }, - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 24, - "line": 88, - "offset": 1789, - }, - "source": "$foo", - "start": Position { - "column": 20, - "line": 88, - "offset": 1785, - }, - }, - "name": "foo", - }, - }, - ], - "kind": "call", - "loc": Location { - "end": Position { - "column": 26, - "line": 88, - "offset": 1791, - }, - "source": "(...$foo);", - "start": Position { - "column": 16, - "line": 88, - "offset": 1781, - }, - }, - "what": PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 16, - "line": 88, - "offset": 1781, - }, - "source": "->kick", - "start": Position { - "column": 10, - "line": 88, - "offset": 1775, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 16, - "line": 88, - "offset": 1781, - }, - "source": "kick", - "start": Position { - "column": 12, - "line": 88, - "offset": 1777, - }, - }, - "name": "kick", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 10, - "line": 88, - "offset": 1775, - }, - "source": "$guy", - "start": Position { - "column": 6, - "line": 88, - "offset": 1771, - }, - }, - "name": "guy", - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 5, - "line": 89, - "offset": 1797, - }, - "source": "{ - $guy->kick(...$foo); - }", - "start": Position { - "column": 11, - "line": 87, - "offset": 1763, - }, - }, - }, - "body": Block { - "children": Array [ - Silent { - "expr": Call { - "arguments": Array [], - "kind": "call", - "loc": Location { - "end": Position { - "column": 19, - "line": 86, - "offset": 1750, - }, - "source": "()", - "start": Position { - "column": 17, - "line": 86, - "offset": 1748, - }, - }, - "what": PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 17, - "line": 86, - "offset": 1748, - }, - "source": "->kill", - "start": Position { - "column": 11, - "line": 86, - "offset": 1742, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 17, - "line": 86, - "offset": 1748, - }, - "source": "kill", - "start": Position { - "column": 13, - "line": 86, - "offset": 1744, - }, - }, - "name": "kill", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 11, - "line": 86, - "offset": 1742, - }, - "source": "$guy", - "start": Position { - "column": 7, - "line": 86, - "offset": 1738, - }, - }, - "name": "guy", - }, - }, - }, - "kind": "silent", - "loc": Location { - "end": Position { - "column": 20, - "line": 86, - "offset": 1751, - }, - "source": "@$guy->kill();", - "start": Position { - "column": 6, - "line": 86, - "offset": 1737, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 5, - "line": 87, - "offset": 1757, - }, - "source": "{ - @$guy->kill(); - }", - "start": Position { - "column": 31, - "line": 85, - "offset": 1729, - }, - }, - }, - "kind": "if", - "loc": Location { - "end": Position { - "column": 5, - "line": 89, - "offset": 1797, - }, - "source": "if(rand(0, 10)>5 || false) { - @$guy->kill(); - } else { - $guy->kick(...$foo); - }", - "start": Position { - "column": 4, - "line": 85, - "offset": 1702, - }, - }, - "shortForm": false, - "test": Bin { - "kind": "bin", - "left": Bin { - "kind": "bin", - "left": Call { - "arguments": Array [ - Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 13, - "line": 85, - "offset": 1711, - }, - "source": "0", - "start": Position { - "column": 12, - "line": 85, - "offset": 1710, - }, - }, - "value": "0", - }, - Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 17, - "line": 85, - "offset": 1715, - }, - "source": "10", - "start": Position { - "column": 15, - "line": 85, - "offset": 1713, - }, - }, - "value": "10", - }, - ], - "kind": "call", - "loc": Location { - "end": Position { - "column": 18, - "line": 85, - "offset": 1716, - }, - "source": "(0, 10)", - "start": Position { - "column": 11, - "line": 85, - "offset": 1709, - }, - }, - "what": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 11, - "line": 85, - "offset": 1709, - }, - "source": "rand", - "start": Position { - "column": 7, - "line": 85, - "offset": 1705, - }, - }, - "name": "rand", - "resolution": "uqn", - }, - }, - "loc": Location { - "end": Position { - "column": 29, - "line": 85, - "offset": 1727, - }, - "source": "rand(0, 10)>5 || false", - "start": Position { - "column": 7, - "line": 85, - "offset": 1705, - }, - }, - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 20, - "line": 85, - "offset": 1718, - }, - "source": "5", - "start": Position { - "column": 19, - "line": 85, - "offset": 1717, - }, - }, - "value": "5", - }, - "type": ">", - }, - "loc": Location { - "end": Position { - "column": 29, - "line": 85, - "offset": 1727, - }, - "source": "5 || false", - "start": Position { - "column": 19, - "line": 85, - "offset": 1717, - }, - }, - "right": Boolean { - "kind": "boolean", - "loc": Location { - "end": Position { - "column": 29, - "line": 85, - "offset": 1727, - }, - "source": "false", - "start": Position { - "column": 24, - "line": 85, - "offset": 1722, - }, - }, - "raw": "false", - "value": false, - }, - "type": "||", - }, - }, - If { - "alternate": null, - "body": Goto { - "kind": "goto", - "label": "next", - "loc": Location { - "end": Position { - "column": 50, - "line": 90, - "offset": 1848, - }, - "source": "goto next;", - "start": Position { - "column": 40, - "line": 90, - "offset": 1838, - }, - }, - }, - "kind": "if", - "loc": Location { - "end": Position { - "column": 50, - "line": 90, - "offset": 1848, - }, - "source": "if ((int)$index < count($persians)) goto next;", - "start": Position { - "column": 4, - "line": 90, - "offset": 1802, - }, - }, - "shortForm": false, - "test": Cast { - "kind": "cast", - "loc": Location { - "end": Position { - "column": 38, - "line": 90, - "offset": 1836, - }, - "source": "(int)$index < count($persians)", - "start": Position { - "column": 8, - "line": 90, - "offset": 1806, - }, - }, - "raw": "(int)", - "type": "int", - "what": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 19, - "line": 90, - "offset": 1817, - }, - "source": "$index", - "start": Position { - "column": 13, - "line": 90, - "offset": 1811, - }, - }, - "name": "index", - }, - "loc": Location { - "end": Position { - "column": 38, - "line": 90, - "offset": 1836, - }, - "source": "$index < count($persians)", - "start": Position { - "column": 13, - "line": 90, - "offset": 1811, - }, - }, - "right": Call { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 37, - "line": 90, - "offset": 1835, - }, - "source": "$persians", - "start": Position { - "column": 28, - "line": 90, - "offset": 1826, - }, - }, - "name": "persians", - }, - ], - "kind": "call", - "loc": Location { - "end": Position { - "column": 38, - "line": 90, - "offset": 1836, - }, - "source": "($persians)", - "start": Position { - "column": 27, - "line": 90, - "offset": 1825, - }, - }, - "what": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 27, - "line": 90, - "offset": 1825, - }, - "source": "count", - "start": Position { - "column": 22, - "line": 90, - "offset": 1820, - }, - }, - "name": "count", - "resolution": "uqn", - }, - }, - "type": "<", - }, - }, - }, - Return { - "expr": Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 14, - "line": 92, - "offset": 1864, - }, - "source": "300", - "start": Position { - "column": 11, - "line": 92, - "offset": 1861, - }, - }, - "value": "300", - }, - "loc": Location { - "end": Position { - "column": 18, - "line": 92, - "offset": 1868, - }, - "source": "300 | 5", - "start": Position { - "column": 11, - "line": 92, - "offset": 1861, - }, - }, - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 18, - "line": 92, - "offset": 1868, - }, - "source": "5", - "start": Position { - "column": 17, - "line": 92, - "offset": 1867, - }, - }, - "value": "5", - }, - "type": "|", - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 19, - "line": 92, - "offset": 1869, - }, - "source": "return 300 | 5;", - "start": Position { - "column": 4, - "line": 92, - "offset": 1854, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 3, - "line": 93, - "offset": 1873, - }, - "source": "{ - global $persians; - - $index = -1; -next: - $guy = $persians[++$index]; - if(rand(0, 10)>5 || false) { - @$guy->kill(); - } else { - $guy->kick(...$foo); - } - if ((int)$index < count($persians)) goto next; - - return 300 | 5; - }", - "start": Position { - "column": 27, - "line": 79, - "offset": 1618, - }, - }, - }, - "byref": false, - "kind": "function", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "loc": Location { - "end": Position { - "column": 0, - "line": 79, - "offset": 1591, - }, - "source": "// this is SPARTA ! -", - "start": Position { - "column": 2, - "line": 78, - "offset": 1571, - }, - }, - "value": "// this is SPARTA ! -", - }, - ], - "loc": Location { - "end": Position { - "column": 3, - "line": 93, - "offset": 1873, - }, - "source": "function sparta() : ?int", - "start": Position { - "column": 2, - "line": 79, - "offset": 1593, - }, - }, - "name": "sparta", - "nullable": true, - "type": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 26, - "line": 79, - "offset": 1617, - }, - "source": "int", - "start": Position { - "column": 23, - "line": 79, - "offset": 1614, - }, - }, - "name": "int", - "resolution": "uqn", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 6, - "line": 95, - "offset": 1881, - }, - "source": "$foo", - "start": Position { - "column": 2, - "line": 95, - "offset": 1877, - }, - }, - "name": "foo", - }, - "loc": Location { - "end": Position { - "column": 4, - "line": 131, - "offset": 2878, - }, - "source": "$foo = function(?int $bar = 42) use($something) : bool { - static $banana; - if($bar > fooBar::NUMBAR) { - while($bar) { - if ((int)calculateMeaningOfLife() === 42) { - break foo; - } else continue; - } - do { - ?> - Caesar: here I was - crazy()->boom([1, 2, 3]); - } catch(Coco|Nut $ex) { - $ex->printStackTrace(); - } finally { - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt(); - } - } else { - for($i = 0; $i < count($this->banana); $i++) { - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - } - // @todo $this->a_$foo - return $$foo ?? false; - } - return empty(namespace\\\\FOOBAR); - };", - "start": Position { - "column": 2, - "line": 95, - "offset": 1877, - }, - }, - "operator": "=", - "right": Closure { - "arguments": Array [ - Parameter { - "byref": false, - "kind": "parameter", - "loc": Location { - "end": Position { - "column": 32, - "line": 95, - "offset": 1907, - }, - "source": "?int $bar = 42", - "start": Position { - "column": 18, - "line": 95, - "offset": 1893, - }, - }, - "name": "bar", - "nullable": true, - "type": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 22, - "line": 95, - "offset": 1897, - }, - "source": "int", - "start": Position { - "column": 19, - "line": 95, - "offset": 1894, - }, - }, - "name": "int", - "resolution": "uqn", - }, - "value": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 32, - "line": 95, - "offset": 1907, - }, - "source": "42", - "start": Position { - "column": 30, - "line": 95, - "offset": 1905, - }, - }, - "value": "42", - }, - "variadic": false, - }, - ], - "body": Block { - "children": Array [ - Static { - "items": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 18, - "line": 96, - "offset": 1952, - }, - "source": "$banana", - "start": Position { - "column": 11, - "line": 96, - "offset": 1945, - }, - }, - "name": "banana", - }, - ], - "kind": "static", - "loc": Location { - "end": Position { - "column": 19, - "line": 96, - "offset": 1953, - }, - "source": "static $banana;", - "start": Position { - "column": 4, - "line": 96, - "offset": 1938, - }, - }, - }, - If { - "alternate": If { - "alternate": Block { - "children": Array [ - For { - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 10, - "line": 124, - "offset": 2691, - }, - "source": "$x", - "start": Position { - "column": 8, - "line": 124, - "offset": 2689, - }, - }, - "name": "x", - }, - "loc": Location { - "end": Position { - "column": 34, - "line": 124, - "offset": 2715, - }, - "source": "$x %= ($i * 2) / ($i - 1);", - "start": Position { - "column": 8, - "line": 124, - "offset": 2689, - }, - }, - "operator": "%=", - "right": Bin { - "kind": "bin", - "left": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 17, - "line": 124, - "offset": 2698, - }, - "source": "$i", - "start": Position { - "column": 15, - "line": 124, - "offset": 2696, - }, - }, - "name": "i", - }, - "loc": Location { - "end": Position { - "column": 21, - "line": 124, - "offset": 2702, - }, - "source": "$i * 2", - "start": Position { - "column": 15, - "line": 124, - "offset": 2696, - }, - }, - "parenthesizedExpression": true, - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 21, - "line": 124, - "offset": 2702, - }, - "source": "2", - "start": Position { - "column": 20, - "line": 124, - "offset": 2701, - }, - }, - "value": "2", - }, - "type": "*", - }, - "loc": Location { - "end": Position { - "column": 33, - "line": 124, - "offset": 2714, - }, - "source": "($i * 2) / ($i - 1)", - "start": Position { - "column": 14, - "line": 124, - "offset": 2695, - }, - }, - "right": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 28, - "line": 124, - "offset": 2709, - }, - "source": "$i", - "start": Position { - "column": 26, - "line": 124, - "offset": 2707, - }, - }, - "name": "i", - }, - "loc": Location { - "end": Position { - "column": 32, - "line": 124, - "offset": 2713, - }, - "source": "$i - 1", - "start": Position { - "column": 26, - "line": 124, - "offset": 2707, - }, - }, - "parenthesizedExpression": true, - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 32, - "line": 124, - "offset": 2713, - }, - "source": "1", - "start": Position { - "column": 31, - "line": 124, - "offset": 2712, - }, - }, - "value": "1", - }, - "type": "-", - }, - "type": "/", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 13, - "line": 125, - "offset": 2729, - }, - "source": "$what", - "start": Position { - "column": 8, - "line": 125, - "offset": 2724, - }, - }, - "name": "what", - }, - "loc": Location { - "end": Position { - "column": 49, - "line": 125, - "offset": 2765, - }, - "source": "$what = $this->$x[++$i] ? 'yes!': 'noo!';", - "start": Position { - "column": 8, - "line": 125, - "offset": 2724, - }, - }, - "operator": "=", - "right": RetIf { - "falseExpr": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 48, - "line": 125, - "offset": 2764, - }, - "source": "'noo!'", - "start": Position { - "column": 42, - "line": 125, - "offset": 2758, - }, - }, - "raw": "'noo!'", - "unicode": false, - "value": "noo!", - }, - "kind": "retif", - "loc": Location { - "end": Position { - "column": 48, - "line": 125, - "offset": 2764, - }, - "source": "$this->$x[++$i] ? 'yes!': 'noo!'", - "start": Position { - "column": 16, - "line": 125, - "offset": 2732, - }, - }, - "test": OffsetLookup { - "kind": "offsetlookup", - "loc": Location { - "end": Position { - "column": 31, - "line": 125, - "offset": 2747, - }, - "source": "[++$i]", - "start": Position { - "column": 25, - "line": 125, - "offset": 2741, - }, - }, - "offset": Pre { - "kind": "pre", - "loc": Location { - "end": Position { - "column": 30, - "line": 125, - "offset": 2746, - }, - "source": "++$i", - "start": Position { - "column": 26, - "line": 125, - "offset": 2742, - }, - }, - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 30, - "line": 125, - "offset": 2746, - }, - "source": "$i", - "start": Position { - "column": 28, - "line": 125, - "offset": 2744, - }, - }, - "name": "i", - }, - }, - "what": PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 25, - "line": 125, - "offset": 2741, - }, - "source": "->$x", - "start": Position { - "column": 21, - "line": 125, - "offset": 2737, - }, - }, - "offset": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 25, - "line": 125, - "offset": 2741, - }, - "source": "$x", - "start": Position { - "column": 23, - "line": 125, - "offset": 2739, - }, - }, - "name": "x", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 21, - "line": 125, - "offset": 2737, - }, - "source": "$this", - "start": Position { - "column": 16, - "line": 125, - "offset": 2732, - }, - }, - "name": "this", - }, - }, - }, - "trueExpr": String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 40, - "line": 125, - "offset": 2756, - }, - "source": "'yes!'", - "start": Position { - "column": 34, - "line": 125, - "offset": 2750, - }, - }, - "raw": "'yes!'", - "unicode": false, - "value": "yes!", - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 7, - "line": 126, - "offset": 2773, - }, - "source": "{ - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - }", - "start": Position { - "column": 51, - "line": 123, - "offset": 2679, - }, - }, - }, - "increment": Array [ - Post { - "kind": "post", - "loc": Location { - "end": Position { - "column": 49, - "line": 123, - "offset": 2677, - }, - "source": "$i++", - "start": Position { - "column": 45, - "line": 123, - "offset": 2673, - }, - }, - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 47, - "line": 123, - "offset": 2675, - }, - "source": "$i", - "start": Position { - "column": 45, - "line": 123, - "offset": 2673, - }, - }, - "name": "i", - }, - }, - ], - "init": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 12, - "line": 123, - "offset": 2640, - }, - "source": "$i", - "start": Position { - "column": 10, - "line": 123, - "offset": 2638, - }, - }, - "name": "i", - }, - "loc": Location { - "end": Position { - "column": 16, - "line": 123, - "offset": 2644, - }, - "source": "$i = 0", - "start": Position { - "column": 10, - "line": 123, - "offset": 2638, - }, - }, - "operator": "=", - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 16, - "line": 123, - "offset": 2644, - }, - "source": "0", - "start": Position { - "column": 15, - "line": 123, - "offset": 2643, - }, - }, - "value": "0", - }, - }, - ], - "kind": "for", - "loc": Location { - "end": Position { - "column": 7, - "line": 126, - "offset": 2773, - }, - "source": "($i = 0; $i < count($this->banana); $i++) { - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - }", - "start": Position { - "column": 9, - "line": 123, - "offset": 2637, - }, - }, - "shortForm": false, - "test": Array [ - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 20, - "line": 123, - "offset": 2648, - }, - "source": "$i", - "start": Position { - "column": 18, - "line": 123, - "offset": 2646, - }, - }, - "name": "i", - }, - "loc": Location { - "end": Position { - "column": 43, - "line": 123, - "offset": 2671, - }, - "source": "$i < count($this->banana)", - "start": Position { - "column": 18, - "line": 123, - "offset": 2646, - }, - }, - "right": Call { - "arguments": Array [ - PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 42, - "line": 123, - "offset": 2670, - }, - "source": "->banana", - "start": Position { - "column": 34, - "line": 123, - "offset": 2662, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 42, - "line": 123, - "offset": 2670, - }, - "source": "banana", - "start": Position { - "column": 36, - "line": 123, - "offset": 2664, - }, - }, - "name": "banana", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 34, - "line": 123, - "offset": 2662, - }, - "source": "$this", - "start": Position { - "column": 29, - "line": 123, - "offset": 2657, - }, - }, - "name": "this", - }, - }, - ], - "kind": "call", - "loc": Location { - "end": Position { - "column": 43, - "line": 123, - "offset": 2671, - }, - "source": "($this->banana)", - "start": Position { - "column": 28, - "line": 123, - "offset": 2656, - }, - }, - "what": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 28, - "line": 123, - "offset": 2656, - }, - "source": "count", - "start": Position { - "column": 23, - "line": 123, - "offset": 2651, - }, - }, - "name": "count", - "resolution": "uqn", - }, - }, - "type": "<", - }, - ], - }, - Return { - "expr": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 18, - "line": 128, - "offset": 2821, - }, - "source": "$$foo", - "start": Position { - "column": 13, - "line": 128, - "offset": 2816, - }, - }, - "name": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 18, - "line": 128, - "offset": 2821, - }, - "source": "$foo", - "start": Position { - "column": 14, - "line": 128, - "offset": 2817, - }, - }, - "name": "foo", - }, - }, - "loc": Location { - "end": Position { - "column": 27, - "line": 128, - "offset": 2830, - }, - "source": "$$foo ?? false", - "start": Position { - "column": 13, - "line": 128, - "offset": 2816, - }, - }, - "right": Boolean { - "kind": "boolean", - "loc": Location { - "end": Position { - "column": 27, - "line": 128, - "offset": 2830, - }, - "source": "false", - "start": Position { - "column": 22, - "line": 128, - "offset": 2825, - }, - }, - "raw": "false", - "value": false, - }, - "type": "??", - }, - "kind": "return", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "loc": Location { - "end": Position { - "column": 0, - "line": 128, - "offset": 2803, - }, - "source": "// @todo $this->a_$foo -", - "start": Position { - "column": 6, - "line": 127, - "offset": 2780, - }, - }, - "value": "// @todo $this->a_$foo -", - }, - ], - "loc": Location { - "end": Position { - "column": 28, - "line": 128, - "offset": 2831, - }, - "source": "return $$foo ?? false;", - "start": Position { - "column": 6, - "line": 128, - "offset": 2809, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 5, - "line": 129, - "offset": 2837, - }, - "source": "{ - for($i = 0; $i < count($this->banana); $i++) { - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - } - // @todo $this->a_$foo - return $$foo ?? false; - }", - "start": Position { - "column": 11, - "line": 122, - "offset": 2626, - }, - }, - }, - "body": Block { - "children": Array [ - Try { - "always": Block { - "children": Array [ - If { - "alternate": null, - "body": Unset { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 46, - "line": 115, - "offset": 2464, - }, - "source": "$bipbip", - "start": Position { - "column": 39, - "line": 115, - "offset": 2457, - }, - }, - "name": "bipbip", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 51, - "line": 115, - "offset": 2469, - }, - "source": "$ex", - "start": Position { - "column": 48, - "line": 115, - "offset": 2466, - }, - }, - "name": "ex", - }, - ], - "kind": "unset", - "loc": Location { - "end": Position { - "column": 53, - "line": 115, - "offset": 2471, - }, - "source": "unset($bipbip, $ex);", - "start": Position { - "column": 33, - "line": 115, - "offset": 2451, - }, - }, - }, - "kind": "if", - "loc": Location { - "end": Position { - "column": 53, - "line": 115, - "offset": 2471, - }, - "source": "if (isset($bipbip, $ex)) unset($bipbip, $ex);", - "start": Position { - "column": 8, - "line": 115, - "offset": 2426, - }, - }, - "shortForm": false, - "test": Isset { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 25, - "line": 115, - "offset": 2443, - }, - "source": "$bipbip", - "start": Position { - "column": 18, - "line": 115, - "offset": 2436, - }, - }, - "name": "bipbip", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 30, - "line": 115, - "offset": 2448, - }, - "source": "$ex", - "start": Position { - "column": 27, - "line": 115, - "offset": 2445, - }, - }, - "name": "ex", - }, - ], - "kind": "isset", - "loc": Location { - "end": Position { - "column": 31, - "line": 115, - "offset": 2449, - }, - "source": "isset($bipbip, $ex)", - "start": Position { - "column": 12, - "line": 115, - "offset": 2430, - }, - }, - }, - }, - Return { - "expr": Call { - "arguments": Array [], - "kind": "call", - "loc": Location { - "end": Position { - "column": 20, - "line": 120, - "offset": 2605, - }, - "source": "()", - "start": Position { - "column": 18, - "line": 120, - "offset": 2603, - }, - }, - "what": PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 18, - "line": 120, - "offset": 2603, - }, - "source": "->goatIt", - "start": Position { - "column": 10, - "line": 120, - "offset": 2595, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 18, - "line": 120, - "offset": 2603, - }, - "source": "goatIt", - "start": Position { - "column": 12, - "line": 120, - "offset": 2597, - }, - }, - "name": "goatIt", - }, - "what": New { - "arguments": Array [], - "kind": "new", - "loc": Location { - "end": Position { - "column": 9, - "line": 120, - "offset": 2594, - }, - "source": "class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - }", - "start": Position { - "column": 20, - "line": 116, - "offset": 2492, - }, - }, - "parenthesizedExpression": true, - "what": Class { - "body": Array [ - Method { - "arguments": Array [], - "body": Block { - "children": Array [ - Return { - "expr": String { - "isDoubleQuote": true, - "kind": "string", - "loc": Location { - "end": Position { - "column": 26, - "line": 118, - "offset": 2571, - }, - "source": "\\"meeeh\\"", - "start": Position { - "column": 19, - "line": 118, - "offset": 2564, - }, - }, - "raw": "\\"meeeh\\"", - "unicode": false, - "value": "meeeh", - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 27, - "line": 118, - "offset": 2572, - }, - "source": "return \\"meeeh\\";", - "start": Position { - "column": 12, - "line": 118, - "offset": 2557, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 11, - "line": 119, - "offset": 2584, - }, - "source": "{ - return \\"meeeh\\"; - }", - "start": Position { - "column": 28, - "line": 117, - "offset": 2543, - }, - }, - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "loc": Location { - "end": Position { - "column": 11, - "line": 119, - "offset": 2584, - }, - "source": "function goatIt()", - "start": Position { - "column": 10, - "line": 117, - "offset": 2525, - }, - }, - "name": "goatIt", - "nullable": false, - "type": null, - "visibility": "", - }, - ], - "extends": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 40, - "line": 116, - "offset": 2512, - }, - "source": "fooBar", - "start": Position { - "column": 34, - "line": 116, - "offset": 2506, - }, - }, - "name": "fooBar", - "resolution": "uqn", - }, - "implements": null, - "isAbstract": false, - "isAnonymous": true, - "isFinal": false, - "kind": "class", - "loc": Location { - "end": Position { - "column": 9, - "line": 120, - "offset": 2594, - }, - "source": "class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - }", - "start": Position { - "column": 20, - "line": 116, - "offset": 2492, - }, - }, - "name": null, - }, - }, - }, - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 21, - "line": 120, - "offset": 2606, - }, - "source": "return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt();", - "start": Position { - "column": 8, - "line": 116, - "offset": 2480, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 7, - "line": 121, - "offset": 2614, - }, - "source": "{ - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt(); - }", - "start": Position { - "column": 16, - "line": 114, - "offset": 2416, - }, - }, - }, - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 15, - "line": 110, - "offset": 2274, - }, - "source": "$bipbip", - "start": Position { - "column": 8, - "line": 110, - "offset": 2267, - }, - }, - "name": "bipbip", - }, - "loc": Location { - "end": Position { - "column": 35, - "line": 110, - "offset": 2294, - }, - "source": "$bipbip = clone $something;", - "start": Position { - "column": 8, - "line": 110, - "offset": 2267, - }, - }, - "operator": "=", - "right": Clone { - "kind": "clone", - "loc": Location { - "end": Position { - "column": 34, - "line": 110, - "offset": 2293, - }, - "source": "clone $something", - "start": Position { - "column": 18, - "line": 110, - "offset": 2277, - }, - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 34, - "line": 110, - "offset": 2293, - }, - "source": "$something", - "start": Position { - "column": 24, - "line": 110, - "offset": 2283, - }, - }, - "name": "something", - }, - }, - }, - Call { - "arguments": Array [ - Array { - "items": Array [ - Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 33, - "line": 111, - "offset": 2328, - }, - "source": "1", - "start": Position { - "column": 32, - "line": 111, - "offset": 2327, - }, - }, - "value": "1", - }, - Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 36, - "line": 111, - "offset": 2331, - }, - "source": "2", - "start": Position { - "column": 35, - "line": 111, - "offset": 2330, - }, - }, - "value": "2", - }, - Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 39, - "line": 111, - "offset": 2334, - }, - "source": "3", - "start": Position { - "column": 38, - "line": 111, - "offset": 2333, - }, - }, - "value": "3", - }, - ], - "kind": "array", - "loc": Location { - "end": Position { - "column": 40, - "line": 111, - "offset": 2335, - }, - "source": "[1, 2, 3]", - "start": Position { - "column": 31, - "line": 111, - "offset": 2326, - }, - }, - "shortForm": true, - }, - ], - "kind": "call", - "loc": Location { - "end": Position { - "column": 42, - "line": 111, - "offset": 2337, - }, - "source": "([1, 2, 3]);", - "start": Position { - "column": 30, - "line": 111, - "offset": 2325, - }, - }, - "what": PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 30, - "line": 111, - "offset": 2325, - }, - "source": "->boom", - "start": Position { - "column": 24, - "line": 111, - "offset": 2319, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 30, - "line": 111, - "offset": 2325, - }, - "source": "boom", - "start": Position { - "column": 26, - "line": 111, - "offset": 2321, - }, - }, - "name": "boom", - }, - "what": Call { - "arguments": Array [], - "kind": "call", - "loc": Location { - "end": Position { - "column": 24, - "line": 111, - "offset": 2319, - }, - "source": "()", - "start": Position { - "column": 22, - "line": 111, - "offset": 2317, - }, - }, - "what": PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 22, - "line": 111, - "offset": 2317, - }, - "source": "->crazy", - "start": Position { - "column": 15, - "line": 111, - "offset": 2310, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 22, - "line": 111, - "offset": 2317, - }, - "source": "crazy", - "start": Position { - "column": 17, - "line": 111, - "offset": 2312, - }, - }, - "name": "crazy", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 15, - "line": 111, - "offset": 2310, - }, - "source": "$bipbip", - "start": Position { - "column": 8, - "line": 111, - "offset": 2303, - }, - }, - "name": "bipbip", - }, - }, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 7, - "line": 112, - "offset": 2345, - }, - "source": "{ - $bipbip = clone $something; - $bipbip->crazy()->boom([1, 2, 3]); - }", - "start": Position { - "column": 10, - "line": 109, - "offset": 2257, - }, - }, - }, - "catches": Array [ - Catch { - "body": Block { - "children": Array [ - Call { - "arguments": Array [], - "kind": "call", - "loc": Location { - "end": Position { - "column": 31, - "line": 113, - "offset": 2399, - }, - "source": "();", - "start": Position { - "column": 28, - "line": 113, - "offset": 2396, - }, - }, - "what": PropertyLookup { - "kind": "propertylookup", - "loc": Location { - "end": Position { - "column": 28, - "line": 113, - "offset": 2396, - }, - "source": "->printStackTrace", - "start": Position { - "column": 11, - "line": 113, - "offset": 2379, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 28, - "line": 113, - "offset": 2396, - }, - "source": "printStackTrace", - "start": Position { - "column": 13, - "line": 113, - "offset": 2381, - }, - }, - "name": "printStackTrace", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 11, - "line": 113, - "offset": 2379, - }, - "source": "$ex", - "start": Position { - "column": 8, - "line": 113, - "offset": 2376, - }, - }, - "name": "ex", - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 7, - "line": 114, - "offset": 2407, - }, - "source": "{ - $ex->printStackTrace(); - }", - "start": Position { - "column": 28, - "line": 112, - "offset": 2366, - }, - }, - }, - "kind": "catch", - "loc": Location { - "end": Position { - "column": 7, - "line": 114, - "offset": 2407, - }, - "source": "catch(Coco|Nut $ex) { - $ex->printStackTrace(); - }", - "start": Position { - "column": 8, - "line": 112, - "offset": 2346, - }, - }, - "variable": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 26, - "line": 112, - "offset": 2364, - }, - "source": "$ex", - "start": Position { - "column": 23, - "line": 112, - "offset": 2361, - }, - }, - "name": "ex", - }, - "what": Array [ - Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 18, - "line": 112, - "offset": 2356, - }, - "source": "Coco", - "start": Position { - "column": 14, - "line": 112, - "offset": 2352, - }, - }, - "name": "Coco", - "resolution": "uqn", - }, - Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 22, - "line": 112, - "offset": 2360, - }, - "source": "Nut", - "start": Position { - "column": 19, - "line": 112, - "offset": 2357, - }, - }, - "name": "Nut", - "resolution": "uqn", - }, - ], - }, - ], - "kind": "try", - "loc": Location { - "end": Position { - "column": 7, - "line": 121, - "offset": 2614, - }, - "source": "try { - $bipbip = clone $something; - $bipbip->crazy()->boom([1, 2, 3]); - } catch(Coco|Nut $ex) { - $ex->printStackTrace(); - } finally { - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt(); - }", - "start": Position { - "column": 6, - "line": 109, - "offset": 2253, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 5, - "line": 122, - "offset": 2620, - }, - "source": "{ - try { - $bipbip = clone $something; - $bipbip->crazy()->boom([1, 2, 3]); - } catch(Coco|Nut $ex) { - $ex->printStackTrace(); - } finally { - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt(); - } - }", - "start": Position { - "column": 48, - "line": 108, - "offset": 2245, - }, - }, - }, - "kind": "if", - "loc": Location { - "end": Position { - "column": 5, - "line": 129, - "offset": 2837, - }, - "source": "if (!($something instanceof Banana)) { - try { - $bipbip = clone $something; - $bipbip->crazy()->boom([1, 2, 3]); - } catch(Coco|Nut $ex) { - $ex->printStackTrace(); - } finally { - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt(); - } - } else { - for($i = 0; $i < count($this->banana); $i++) { - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - } - // @todo $this->a_$foo - return $$foo ?? false; - }", - "start": Position { - "column": 11, - "line": 108, - "offset": 2208, - }, - }, - "shortForm": false, - "test": Unary { - "kind": "unary", - "loc": Location { - "end": Position { - "column": 46, - "line": 108, - "offset": 2243, - }, - "source": "!($something instanceof Banana)", - "start": Position { - "column": 15, - "line": 108, - "offset": 2212, - }, - }, - "type": "!", - "what": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 27, - "line": 108, - "offset": 2224, - }, - "source": "$something", - "start": Position { - "column": 17, - "line": 108, - "offset": 2214, - }, - }, - "name": "something", - }, - "loc": Location { - "end": Position { - "column": 45, - "line": 108, - "offset": 2242, - }, - "source": "$something instanceof Banana", - "start": Position { - "column": 17, - "line": 108, - "offset": 2214, - }, - }, - "parenthesizedExpression": true, - "right": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 45, - "line": 108, - "offset": 2242, - }, - "source": "Banana", - "start": Position { - "column": 39, - "line": 108, - "offset": 2236, - }, - }, - "name": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 45, - "line": 108, - "offset": 2242, - }, - "source": "Banana", - "start": Position { - "column": 39, - "line": 108, - "offset": 2236, - }, - }, - "name": "Banana", - "resolution": "uqn", - }, - }, - "type": "instanceof", - }, - }, - }, - "body": Block { - "children": Array [ - While { - "body": Block { - "children": Array [ - If { - "alternate": Continue { - "kind": "continue", - "level": null, - "loc": Location { - "end": Position { - "column": 24, - "line": 101, - "offset": 2103, - }, - "source": "continue;", - "start": Position { - "column": 15, - "line": 101, - "offset": 2094, - }, - }, - }, - "body": Block { - "children": Array [ - Break { - "kind": "break", - "level": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 19, - "line": 100, - "offset": 2077, - }, - "source": "foo", - "start": Position { - "column": 16, - "line": 100, - "offset": 2074, - }, - }, - "name": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 19, - "line": 100, - "offset": 2077, - }, - "source": "foo", - "start": Position { - "column": 16, - "line": 100, - "offset": 2074, - }, - }, - "name": "foo", - "resolution": "uqn", - }, - }, - "loc": Location { - "end": Position { - "column": 20, - "line": 100, - "offset": 2078, - }, - "source": "break foo;", - "start": Position { - "column": 10, - "line": 100, - "offset": 2068, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 9, - "line": 101, - "offset": 2088, - }, - "source": "{ - break foo; - }", - "start": Position { - "column": 50, - "line": 99, - "offset": 2056, - }, - }, - }, - "kind": "if", - "loc": Location { - "end": Position { - "column": 24, - "line": 101, - "offset": 2103, - }, - "source": "if ((int)calculateMeaningOfLife() === 42) { - break foo; - } else continue;", - "start": Position { - "column": 8, - "line": 99, - "offset": 2014, - }, - }, - "shortForm": false, - "test": Cast { - "kind": "cast", - "loc": Location { - "end": Position { - "column": 48, - "line": 99, - "offset": 2054, - }, - "source": "(int)calculateMeaningOfLife() === 42", - "start": Position { - "column": 12, - "line": 99, - "offset": 2018, - }, - }, - "raw": "(int)", - "type": "int", - "what": Bin { - "kind": "bin", - "left": Call { - "arguments": Array [], - "kind": "call", - "loc": Location { - "end": Position { - "column": 41, - "line": 99, - "offset": 2047, - }, - "source": "()", - "start": Position { - "column": 39, - "line": 99, - "offset": 2045, - }, - }, - "what": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 39, - "line": 99, - "offset": 2045, - }, - "source": "calculateMeaningOfLife", - "start": Position { - "column": 17, - "line": 99, - "offset": 2023, - }, - }, - "name": "calculateMeaningOfLife", - "resolution": "uqn", - }, - }, - "loc": Location { - "end": Position { - "column": 48, - "line": 99, - "offset": 2054, - }, - "source": "calculateMeaningOfLife() === 42", - "start": Position { - "column": 17, - "line": 99, - "offset": 2023, - }, - }, - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 48, - "line": 99, - "offset": 2054, - }, - "source": "42", - "start": Position { - "column": 46, - "line": 99, - "offset": 2052, - }, - }, - "value": "42", - }, - "type": "===", - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 7, - "line": 102, - "offset": 2111, - }, - "source": "{ - if ((int)calculateMeaningOfLife() === 42) { - break foo; - } else continue; - }", - "start": Position { - "column": 18, - "line": 98, - "offset": 2004, - }, - }, - }, - "kind": "while", - "loc": Location { - "end": Position { - "column": 7, - "line": 102, - "offset": 2111, - }, - "source": "($bar) { - if ((int)calculateMeaningOfLife() === 42) { - break foo; - } else continue; - }", - "start": Position { - "column": 11, - "line": 98, - "offset": 1997, - }, - }, - "shortForm": false, - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 16, - "line": 98, - "offset": 2002, - }, - "source": "$bar", - "start": Position { - "column": 12, - "line": 98, - "offset": 1998, - }, - }, - "name": "bar", - }, - }, - Do { - "body": Block { - "children": Array [ - Inline { - "kind": "inline", - "loc": Location { - "end": Position { - "column": 8, - "line": 106, - "offset": 2169, - }, - "source": " Caesar: here I was - ", - "start": Position { - "column": 0, - "line": 105, - "offset": 2134, - }, - }, - "raw": " - Caesar: here I was - ", - "value": " Caesar: here I was - ", - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 7, - "line": 107, - "offset": 2182, - }, - "source": "{ - ?> - Caesar: here I was - - Caesar: here I was - - Caesar: here I was - fooBar::NUMBAR) { - while($bar) { - if ((int)calculateMeaningOfLife() === 42) { - break foo; - } else continue; - } - do { - ?> - Caesar: here I was - crazy()->boom([1, 2, 3]); - } catch(Coco|Nut $ex) { - $ex->printStackTrace(); - } finally { - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt(); - } - } else { - for($i = 0; $i < count($this->banana); $i++) { - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - } - // @todo $this->a_$foo - return $$foo ?? false; - }", - "start": Position { - "column": 4, - "line": 97, - "offset": 1958, - }, - }, - "shortForm": false, - "test": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 11, - "line": 97, - "offset": 1965, - }, - "source": "$bar", - "start": Position { - "column": 7, - "line": 97, - "offset": 1961, - }, - }, - "name": "bar", - }, - "loc": Location { - "end": Position { - "column": 28, - "line": 97, - "offset": 1982, - }, - "source": "$bar > fooBar::NUMBAR", - "start": Position { - "column": 7, - "line": 97, - "offset": 1961, - }, - }, - "right": StaticLookup { - "kind": "staticlookup", - "loc": Location { - "end": Position { - "column": 28, - "line": 97, - "offset": 1982, - }, - "source": "::NUMBAR", - "start": Position { - "column": 20, - "line": 97, - "offset": 1974, - }, - }, - "offset": ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 28, - "line": 97, - "offset": 1982, - }, - "source": "NUMBAR", - "start": Position { - "column": 22, - "line": 97, - "offset": 1976, - }, - }, - "name": "NUMBAR", - }, - "what": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 20, - "line": 97, - "offset": 1974, - }, - "source": "fooBar", - "start": Position { - "column": 14, - "line": 97, - "offset": 1968, - }, - }, - "name": "fooBar", - "resolution": "uqn", - }, - }, - "type": ">", - }, - }, - Return { - "expr": Empty { - "arguments": Array [ - ConstRef { - "kind": "constref", - "loc": Location { - "end": Position { - "column": 33, - "line": 130, - "offset": 2871, - }, - "source": "namespace\\\\FOOBAR", - "start": Position { - "column": 17, - "line": 130, - "offset": 2855, - }, - }, - "name": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 33, - "line": 130, - "offset": 2871, - }, - "source": "namespace\\\\FOOBAR", - "start": Position { - "column": 17, - "line": 130, - "offset": 2855, - }, - }, - "name": "FOOBAR", - "resolution": "rn", - }, - }, - ], - "kind": "empty", - "loc": Location { - "end": Position { - "column": 34, - "line": 130, - "offset": 2872, - }, - "source": "empty(namespace\\\\FOOBAR)", - "start": Position { - "column": 11, - "line": 130, - "offset": 2849, - }, - }, - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 35, - "line": 130, - "offset": 2873, - }, - "source": "return empty(namespace\\\\FOOBAR);", - "start": Position { - "column": 4, - "line": 130, - "offset": 2842, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 3, - "line": 131, - "offset": 2877, - }, - "source": "{ - static $banana; - if($bar > fooBar::NUMBAR) { - while($bar) { - if ((int)calculateMeaningOfLife() === 42) { - break foo; - } else continue; - } - do { - ?> - Caesar: here I was - crazy()->boom([1, 2, 3]); - } catch(Coco|Nut $ex) { - $ex->printStackTrace(); - } finally { - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt(); - } - } else { - for($i = 0; $i < count($this->banana); $i++) { - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - } - // @todo $this->a_$foo - return $$foo ?? false; - } - return empty(namespace\\\\FOOBAR); - }", - "start": Position { - "column": 57, - "line": 95, - "offset": 1932, - }, - }, - }, - "byref": false, - "isStatic": false, - "kind": "closure", - "loc": Location { - "end": Position { - "column": 3, - "line": 131, - "offset": 2877, - }, - "source": "function(?int $bar = 42) use($something) : bool", - "start": Position { - "column": 9, - "line": 95, - "offset": 1884, - }, - }, - "nullable": false, - "type": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 56, - "line": 95, - "offset": 1931, - }, - "source": "bool", - "start": Position { - "column": 52, - "line": 95, - "offset": 1927, - }, - }, - "name": "bool", - "resolution": "uqn", - }, - "uses": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 48, - "line": 95, - "offset": 1923, - }, - "source": "$something", - "start": Position { - "column": 38, - "line": 95, - "offset": 1913, - }, - }, - "name": "something", - }, - ], - }, - }, - If { - "alternate": If { - "alternate": null, - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "loc": Location { - "end": Position { - "column": 20, - "line": 136, - "offset": 2947, - }, - "source": "ls -larth\`", - "start": Position { - "column": 10, - "line": 136, - "offset": 2937, - }, - }, - "raw": "\`ls -larth\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 19, - "line": 136, - "offset": 2946, - }, - "source": "ls -larth", - "start": Position { - "column": 10, - "line": 136, - "offset": 2937, - }, - }, - "raw": "ls -larth", - "unicode": false, - "value": "ls -larth", - }, - ], - }, - ], - "kind": "echo", - "loc": Location { - "end": Position { - "column": 21, - "line": 136, - "offset": 2948, - }, - "source": "echo \`ls -larth\`;", - "start": Position { - "column": 4, - "line": 136, - "offset": 2931, - }, - }, - "shortForm": false, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 21, - "line": 136, - "offset": 2948, - }, - "source": "echo \`ls -larth\`;", - "start": Position { - "column": 4, - "line": 136, - "offset": 2931, - }, - }, - }, - "kind": "if", - "loc": Location { - "end": Position { - "column": 21, - "line": 136, - "offset": 2948, - }, - "source": "elseif ($bar): - echo \`ls -larth\`;", - "start": Position { - "column": 2, - "line": 135, - "offset": 2912, - }, - }, - "shortForm": true, - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 14, - "line": 135, - "offset": 2924, - }, - "source": "$bar", - "start": Position { - "column": 10, - "line": 135, - "offset": 2920, - }, - }, - "name": "bar", - }, - }, - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "loc": Location { - "end": Position { - "column": 15, - "line": 134, - "offset": 2908, - }, - "source": "bar&\`", - "start": Position { - "column": 10, - "line": 134, - "offset": 2903, - }, - }, - "raw": "\`bar&\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 14, - "line": 134, - "offset": 2907, - }, - "source": "bar&", - "start": Position { - "column": 10, - "line": 134, - "offset": 2903, - }, - }, - "raw": "bar&", - "unicode": false, - "value": "bar&", - }, - ], - }, - ], - "kind": "echo", - "loc": Location { - "end": Position { - "column": 16, - "line": 134, - "offset": 2909, - }, - "source": "echo \`bar&\`;", - "start": Position { - "column": 4, - "line": 134, - "offset": 2897, - }, - }, - "shortForm": false, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 21, - "line": 136, - "offset": 2948, - }, - "source": "echo \`bar&\`; - elseif ($bar): - echo \`ls -larth\`;", - "start": Position { - "column": 4, - "line": 134, - "offset": 2897, - }, - }, - }, - "kind": "if", - "loc": Location { - "end": Position { - "column": 8, - "line": 137, - "offset": 2957, - }, - "source": "if ($foo): - echo \`bar&\`; - elseif ($bar): - echo \`ls -larth\`; - endif;", - "start": Position { - "column": 2, - "line": 133, - "offset": 2882, - }, - }, - "shortForm": true, - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 10, - "line": 133, - "offset": 2890, - }, - "source": "$foo", - "start": Position { - "column": 6, - "line": 133, - "offset": 2886, - }, - }, - "name": "foo", - }, - }, - Assign { - "kind": "assign", - "left": List { - "arguments": Array [ - null, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 10, - "line": 140, - "offset": 2987, - }, - "source": "$a", - "start": Position { - "column": 8, - "line": 140, - "offset": 2985, - }, - }, - "name": "a", - }, - List { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 19, - "line": 140, - "offset": 2996, - }, - "source": "$b", - "start": Position { - "column": 17, - "line": 140, - "offset": 2994, - }, - }, - "name": "b", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 23, - "line": 140, - "offset": 3000, - }, - "source": "$c", - "start": Position { - "column": 21, - "line": 140, - "offset": 2998, - }, - }, - "name": "c", - }, - ], - "kind": "list", - "loc": Location { - "end": Position { - "column": 24, - "line": 140, - "offset": 3001, - }, - "source": "list($b, $c)", - "start": Position { - "column": 12, - "line": 140, - "offset": 2989, - }, - }, - "shortForm": false, - }, - ], - "kind": "list", - "loc": Location { - "end": Position { - "column": 25, - "line": 140, - "offset": 3002, - }, - "source": "list(,$a, list($b, $c))", - "start": Position { - "column": 2, - "line": 140, - "offset": 2979, - }, - }, - "shortForm": false, - }, - "loc": Location { - "end": Position { - "column": 40, - "line": 140, - "offset": 3017, - }, - "source": "list(,$a, list($b, $c)) = [1, [2, 3]];", - "start": Position { - "column": 2, - "line": 140, - "offset": 2979, - }, - }, - "operator": "=", - "right": Array { - "items": Array [ - Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 30, - "line": 140, - "offset": 3007, - }, - "source": "1", - "start": Position { - "column": 29, - "line": 140, - "offset": 3006, - }, - }, - "value": "1", - }, - Array { - "items": Array [ - Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 34, - "line": 140, - "offset": 3011, - }, - "source": "2", - "start": Position { - "column": 33, - "line": 140, - "offset": 3010, - }, - }, - "value": "2", - }, - Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 37, - "line": 140, - "offset": 3014, - }, - "source": "3", - "start": Position { - "column": 36, - "line": 140, - "offset": 3013, - }, - }, - "value": "3", - }, - ], - "kind": "array", - "loc": Location { - "end": Position { - "column": 38, - "line": 140, - "offset": 3015, - }, - "source": "[2, 3]", - "start": Position { - "column": 32, - "line": 140, - "offset": 3009, - }, - }, - "shortForm": true, - }, - ], - "kind": "array", - "loc": Location { - "end": Position { - "column": 39, - "line": 140, - "offset": 3016, - }, - "source": "[1, [2, 3]]", - "start": Position { - "column": 28, - "line": 140, - "offset": 3005, - }, - }, - "shortForm": true, - }, - }, - Assign { - "kind": "assign", - "left": List { - "arguments": Array [ - null, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 6, - "line": 141, - "offset": 3024, - }, - "source": "$a", - "start": Position { - "column": 4, - "line": 141, - "offset": 3022, - }, - }, - "name": "a", - }, - Array { - "items": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 10, - "line": 141, - "offset": 3028, - }, - "source": "$b", - "start": Position { - "column": 8, - "line": 141, - "offset": 3026, - }, - }, - "name": "b", - }, - null, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 15, - "line": 141, - "offset": 3033, - }, - "source": "$c", - "start": Position { - "column": 13, - "line": 141, - "offset": 3031, - }, - }, - "name": "c", - }, - ], - "kind": "array", - "loc": Location { - "end": Position { - "column": 16, - "line": 141, - "offset": 3034, - }, - "source": "[$b, ,$c]", - "start": Position { - "column": 7, - "line": 141, - "offset": 3025, - }, - }, - "shortForm": true, - }, - ], - "kind": "list", - "loc": Location { - "end": Position { - "column": 17, - "line": 141, - "offset": 3035, - }, - "source": "[,$a,[$b, ,$c]]", - "start": Position { - "column": 2, - "line": 141, - "offset": 3020, - }, - }, - "shortForm": true, - }, - "loc": Location { - "end": Position { - "column": 23, - "line": 141, - "offset": 3041, - }, - "source": "[,$a,[$b, ,$c]] = $f;", - "start": Position { - "column": 2, - "line": 141, - "offset": 3020, - }, - }, - "operator": "=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 22, - "line": 141, - "offset": 3040, - }, - "source": "$f", - "start": Position { - "column": 20, - "line": 141, - "offset": 3038, - }, - }, - "name": "f", - }, - }, - Print { - "arguments": Encapsed { - "kind": "encapsed", - "label": "BAZ", - "loc": Location { - "end": Position { - "column": 3, - "line": 144, - "offset": 3074, - }, - "source": " Hello world -BAZ", - "start": Position { - "column": 0, - "line": 143, - "offset": 3057, - }, - }, - "parenthesizedExpression": true, - "raw": " - Hello world -BAZ -", - "type": "heredoc", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "loc": Location { - "end": Position { - "column": 0, - "line": 144, - "offset": 3071, - }, - "source": " Hello world -", - "start": Position { - "column": 0, - "line": 143, - "offset": 3057, - }, - }, - "raw": " Hello world -", - "unicode": false, - "value": " Hello world -", - }, - ], - }, - "kind": "print", - "loc": Location { - "end": Position { - "column": 2, - "line": 145, - "offset": 3077, - }, - "source": "print(<<Hello 'achoum', - 'bashful' => 'tadah' - ]; - /** - * Something is done here - */ - final public function doSomething() { - // do not wanna do - foreach($this->dwarf as $name => $greeting) { - echo \\"Hey ho $name, $greeting !\\"; - continue $foo; - } - throw new \\\\ComeToHome('Thats it'); - } - } - - interface Miror extends Object { - public function Am_I_Uggly() : bool; - protected function broken() : bool; - static protected function isWhiteSnowAlive() : bool; - } - - function iter() { - yield 'ator' => $foo; - yield from iter(50); - } - - trait Line { - public function draw(bool $arrow = false) : string { - switch($this->style) { - case 'dot': - case 'point': - $body = '......'; - break; - default: - $body = '-----'; - break; - } - return $body . ($arrow ? '>' : ''); - } - private function shuut() { - return __NAMESPACE__; - } - } - - // this is SPARTA ! - function sparta() : ?int { - global $persians; - - $index = -1; -next: - $guy = $persians[++$index]; - if(rand(0, 10)>5 || false) { - @$guy->kill(); - } else { - $guy->kick(...$foo); - } - if ((int)$index < count($persians)) goto next; - - return 300 | 5; - } - - $foo = function(?int $bar = 42) use($something) : bool { - static $banana; - if($bar > fooBar::NUMBAR) { - while($bar) { - if ((int)calculateMeaningOfLife() === 42) { - break foo; - } else continue; - } - do { - ?> - Caesar: here I was - crazy()->boom([1, 2, 3]); - } catch(Coco|Nut $ex) { - $ex->printStackTrace(); - } finally { - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt(); - } - } else { - for($i = 0; $i < count($this->banana); $i++) { - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - } - // @todo $this->a_$foo - return $$foo ?? false; - } - return empty(namespace\\\\FOOBAR); - }; - - if ($foo): - echo \`bar&\`; - elseif ($bar): - echo \`ls -larth\`; - endif; - - // list version - list(,$a, list($b, $c)) = [1, [2, 3]]; - [,$a,[$b, ,$c]] = $f; - print(<<a_$foo -", - "start": Position { - "column": 6, - "line": 127, - "offset": 2780, - }, - }, - "value": "// @todo $this->a_$foo -", - }, - CommentLine { - "kind": "commentline", - "loc": Location { - "end": Position { - "column": 0, - "line": 140, - "offset": 2977, - }, - "source": "// list version -", - "start": Position { - "column": 2, - "line": 139, - "offset": 2961, - }, - }, - "value": "// list version -", - }, - ], - "errors": Array [], - "kind": "program", - "loc": Location { - "end": Position { - "column": 18, - "line": 156, - "offset": 3191, - }, - "source": "#!/usr/bin/php - -Hello 'achoum', - 'bashful' => 'tadah' - ]; - /** - * Something is done here - */ - final public function doSomething() { - // do not wanna do - foreach($this->dwarf as $name => $greeting) { - echo \\"Hey ho $name, $greeting !\\"; - continue $foo; - } - throw new \\\\ComeToHome('Thats it'); - } - } - - interface Miror extends Object { - public function Am_I_Uggly() : bool; - protected function broken() : bool; - static protected function isWhiteSnowAlive() : bool; - } - - function iter() { - yield 'ator' => $foo; - yield from iter(50); - } - - trait Line { - public function draw(bool $arrow = false) : string { - switch($this->style) { - case 'dot': - case 'point': - $body = '......'; - break; - default: - $body = '-----'; - break; - } - return $body . ($arrow ? '>' : ''); - } - private function shuut() { - return __NAMESPACE__; - } - } - - // this is SPARTA ! - function sparta() : ?int { - global $persians; - - $index = -1; -next: - $guy = $persians[++$index]; - if(rand(0, 10)>5 || false) { - @$guy->kill(); - } else { - $guy->kick(...$foo); - } - if ((int)$index < count($persians)) goto next; - - return 300 | 5; - } - - $foo = function(?int $bar = 42) use($something) : bool { - static $banana; - if($bar > fooBar::NUMBAR) { - while($bar) { - if ((int)calculateMeaningOfLife() === 42) { - break foo; - } else continue; - } - do { - ?> - Caesar: here I was - crazy()->boom([1, 2, 3]); - } catch(Coco|Nut $ex) { - $ex->printStackTrace(); - } finally { - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return \\"meeeh\\"; - } - })->goatIt(); - } - } else { - for($i = 0; $i < count($this->banana); $i++) { - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - } - // @todo $this->a_$foo - return $$foo ?? false; - } - return empty(namespace\\\\FOOBAR); - }; - - if ($foo): - echo \`bar&\`; - elseif ($bar): - echo \`ls -larth\`; - endif; - - // list version - list(,$a, list($b, $c)) = [1, [2, 3]]; - [,$a,[$b, ,$c]] = $f; - print(<<?>", - "value": "?>?>", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test clone 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Clone { - "kind": "clone", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test coalesce operator 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - "operator": "=", - "right": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - "type": "??", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test constants 1`] = ` -Program { - "children": Array [ - Constant { - "kind": "constant", - "name": "FOO", - "value": Number { - "kind": "number", - "value": "3.14", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test die/exit 1`] = ` -Program { - "children": Array [ - Exit { - "kind": "exit", - "status": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"bye\\"", - "unicode": false, - "value": "bye", - }, - "useDie": true, - }, - Exit { - "kind": "exit", - "status": Number { - "kind": "number", - "value": "-1", - }, - "useDie": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test echo, isset, unset, empty 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - RetIf { - "falseExpr": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"ko\\"", - "unicode": false, - "value": "ko", - }, - "kind": "retif", - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "expr", - "parenthesizedExpression": true, - }, - "trueExpr": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"ok\\"", - "unicode": false, - "value": "ok", - }, - }, - ], - "kind": "echo", - "shortForm": false, - }, - Print { - "arguments": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"some text\\"", - "unicode": false, - "value": "some text", - }, - "kind": "print", - }, - Isset { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "bar", - }, - ], - "kind": "isset", - }, - Unset { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - ], - "kind": "unset", - }, - Empty { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - ], - "kind": "empty", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test eval 1`] = ` -Program { - "children": Array [ - Eval { - "kind": "eval", - "source": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"return true;\\"", - "unicode": false, - "value": "return true;", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test include / require 1`] = ` -Program { - "children": Array [ - Include { - "kind": "include", - "once": false, - "require": false, - "target": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"file.php\\"", - "unicode": false, - "value": "file.php", - }, - }, - Include { - "kind": "include", - "once": true, - "require": false, - "target": Bin { - "kind": "bin", - "left": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "PATH", - "resolution": "uqn", - }, - }, - "parenthesizedExpression": true, - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"/file.php\\"", - "unicode": false, - "value": "/file.php", - }, - "type": ".", - }, - }, - Include { - "kind": "include", - "once": false, - "require": true, - "target": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"req.php\\"", - "unicode": false, - "value": "req.php", - }, - }, - Include { - "kind": "include", - "once": true, - "require": true, - "target": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"file.php\\"", - "unicode": false, - "value": "file.php", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test inline 1`] = ` -Program { - "children": Array [ - Inline { - "kind": "inline", - "raw": "Hello ", - "value": "Hello ", - }, - Echo { - "arguments": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "'World'", - "unicode": false, - "value": "World", - }, - ], - "kind": "echo", - "shortForm": false, - }, - Inline { - "kind": "inline", - "raw": " - !", - "value": " !", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test magics 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Magic { - "kind": "magic", - "raw": "__FILE__", - "value": "__FILE__", - }, - Magic { - "kind": "magic", - "raw": "__DIR__", - "value": "__DIR__", - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test program 1`] = ` -Program { - "children": Array [], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test shell 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\`ls -larth\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "ls -larth", - "unicode": false, - "value": "ls -larth", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test AST structure test syntax error 1`] = `"Parse Error : syntax error, unexpected '$b' (T_VARIABLE), expecting ';' on line 3"`; diff --git a/test/snapshot/__snapshots__/buffer.test.js.snap b/test/snapshot/__snapshots__/buffer.test.js.snap deleted file mode 100644 index d5ecae39b..000000000 --- a/test/snapshot/__snapshots__/buffer.test.js.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test buffers handles buffers as input 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"test\\"", - "unicode": false, - "value": "test", - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/class.test.js.snap b/test/snapshot/__snapshots__/class.test.js.snap deleted file mode 100644 index 6252efbcc..000000000 --- a/test/snapshot/__snapshots__/class.test.js.snap +++ /dev/null @@ -1,833 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test classes Advanced tests 1`] = ` -Program { - "children": Array [ - Class { - "body": Array [ - TraitUse { - "adaptations": null, - "kind": "traituse", - "traits": Array [ - Identifier { - "kind": "identifier", - "name": "A", - "resolution": "uqn", - }, - ], - }, - TraitUse { - "adaptations": Array [ - TraitAlias { - "as": "bar", - "kind": "traitalias", - "method": "foo", - "trait": null, - "visibility": "", - }, - ], - "kind": "traituse", - "traits": Array [ - Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - ], - }, - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "property", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "// comment -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* boo */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/** doc - * data - foo - */", - }, - ], - "name": "var", - "value": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - "visibility": "public", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [], - "kind": "block", - }, - "byref": false, - "isAbstract": false, - "isFinal": true, - "isStatic": false, - "kind": "method", - "name": "__construct", - "nullable": false, - "type": null, - "visibility": "", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [], - "kind": "block", - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": "boo", - "nullable": false, - "type": null, - "visibility": "private", - }, - ], - "extends": null, - "implements": Array [ - Identifier { - "kind": "identifier", - "name": "boo", - "resolution": "uqn", - }, - ], - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "name": "foo", - }, - Interface { - "body": Array [ - ClassConstant { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "classconstant", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "// some doc -", - }, - ], - "name": "A", - "value": Number { - "kind": "number", - "value": "1.5", - }, - "visibility": "", - }, - Method { - "arguments": Array [], - "body": null, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/** foo */", - }, - ], - "name": "foo", - "nullable": false, - "type": null, - "visibility": "protected", - }, - ], - "extends": Array [ - Identifier { - "kind": "identifier", - "name": "something", - "resolution": "uqn", - }, - ], - "kind": "interface", - "name": "boo", - }, - Trait { - "body": Array [ - ClassConstant { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "classconstant", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "// some doc -", - }, - ], - "name": "A", - "value": Number { - "kind": "number", - "value": "1.5", - }, - "visibility": "", - }, - Method { - "arguments": Array [], - "body": null, - "byref": false, - "isAbstract": true, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": "foo", - "nullable": false, - "type": null, - "visibility": "protected", - }, - ], - "extends": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - "implements": Array [ - Identifier { - "kind": "identifier", - "name": "boo", - "resolution": "uqn", - }, - ], - "kind": "trait", - "name": "line", - }, - ], - "comments": Array [ - CommentLine { - "kind": "commentline", - "value": "// comment -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* boo */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/** doc - * data - foo - */", - }, - CommentLine { - "kind": "commentline", - "value": "// some doc -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/** foo */", - }, - CommentLine { - "kind": "commentline", - "value": "// some doc -", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test classes Test js properties 1`] = ` -Program { - "children": Array [ - Class { - "body": Array [ - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": true, - "kind": "property", - "name": "constructor", - "value": null, - "visibility": "", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [], - "kind": "block", - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": "constructor", - "nullable": false, - "type": null, - "visibility": "public", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "constructor", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "this", - }, - }, - "operator": "=", - "right": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "null", - "resolution": "uqn", - }, - }, - }, - Assign { - "kind": "assign", - "left": StaticLookup { - "kind": "staticlookup", - "offset": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "constructor", - }, - "what": Identifier { - "kind": "identifier", - "name": "self", - "resolution": "uqn", - }, - }, - "operator": "=", - "right": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "null", - "resolution": "uqn", - }, - }, - }, - ], - "kind": "block", - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": "__proto__", - "nullable": false, - "type": null, - "visibility": "public", - }, - ], - "extends": null, - "implements": null, - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "name": "__proto__", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test classes Test of silent mode 1`] = ` -Program { - "children": Array [ - Class { - "body": Array [ - TraitUse { - "adaptations": null, - "kind": "traituse", - "traits": Array [ - Identifier { - "kind": "identifier", - "name": "A", - "resolution": "uqn", - }, - ], - }, - TraitUse { - "adaptations": Array [ - TraitAlias { - "as": null, - "kind": "traitalias", - "method": "foo", - "trait": null, - "visibility": "", - }, - TraitAlias { - "as": null, - "kind": "traitalias", - "method": "", - "trait": null, - "visibility": "", - }, - ], - "kind": "traituse", - "traits": Array [ - Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - ], - }, - ], - "extends": null, - "implements": null, - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "name": "foo", - }, - ], - "errors": Array [ - Error { - "expected": ";", - "kind": "error", - "line": 4, - "message": "Parse Error : syntax error, unexpected 'use' (T_USE), expecting ';' on line 4", - "token": "'use' (T_USE)", - }, - Error { - "expected": Array [ - 119, - 200, - ], - "kind": "error", - "line": 4, - "message": "Parse Error : syntax error, unexpected '}' on line 4", - "token": "'}'", - }, - Error { - "expected": ";", - "kind": "error", - "line": 4, - "message": "Parse Error : syntax error, unexpected '}', expecting ';' on line 4", - "token": "'}'", - }, - Error { - "expected": 105, - "kind": "error", - "line": 4, - "message": "Parse Error : syntax error, unexpected ';', expecting T_STRING on line 4", - "token": "';'", - }, - Error { - "expected": Array [ - 119, - 200, - ], - "kind": "error", - "line": 4, - "message": "Parse Error : syntax error, unexpected ';' on line 4", - "token": "';'", - }, - Error { - "expected": "}", - "kind": "error", - "line": 5, - "message": "Parse Error : syntax error, expecting '}' on line 5", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test classes Validate usual declarations 1`] = ` -Program { - "children": Array [ - Class { - "body": Array [ - ClassConstant { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "classconstant", - "name": "FOO", - "value": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"azerty\\"", - "unicode": false, - "value": "azerty", - }, - "visibility": "", - }, - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": true, - "kind": "property", - "name": "var", - "value": null, - "visibility": "public", - }, - Method { - "arguments": Array [ - Parameter { - "byref": false, - "kind": "parameter", - "name": "data", - "nullable": false, - "type": Identifier { - "kind": "identifier", - "name": "\\\\array", - "resolution": "fqn", - }, - "value": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "null", - "resolution": "uqn", - }, - }, - "variadic": false, - }, - ], - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "data", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "this", - }, - }, - "operator": "=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "data", - }, - }, - ], - "kind": "block", - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": "__construct", - "nullable": false, - "type": null, - "visibility": "public", - }, - ClassConstant { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "classconstant", - "name": "list", - "value": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"bar\\"", - "unicode": false, - "value": "bar", - }, - "visibility": "", - }, - Method { - "arguments": Array [ - Parameter { - "byref": false, - "kind": "parameter", - "name": "foo", - "nullable": false, - "type": null, - "value": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "list", - }, - "what": Identifier { - "kind": "identifier", - "name": "self", - "resolution": "uqn", - }, - }, - "variadic": false, - }, - ], - "body": Block { - "children": Array [ - Return { - "expr": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "list", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "this", - }, - }, - "kind": "return", - }, - ], - "kind": "block", - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": "new", - "nullable": false, - "type": null, - "visibility": "public", - }, - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "property", - "name": "foo", - "value": null, - "visibility": "protected", - }, - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "property", - "name": "bar", - "value": null, - "visibility": "private", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [], - "kind": "block", - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": "foobar", - "nullable": false, - "type": null, - "visibility": "", - }, - ], - "extends": Identifier { - "kind": "identifier", - "name": "bar", - "resolution": "uqn", - }, - "implements": Array [ - Identifier { - "kind": "identifier", - "name": "bim", - "resolution": "uqn", - }, - Identifier { - "kind": "identifier", - "name": "bam", - "resolution": "uqn", - }, - Identifier { - "kind": "identifier", - "name": "boum", - "resolution": "uqn", - }, - ], - "isAbstract": false, - "isAnonymous": false, - "isFinal": true, - "kind": "class", - "name": "foo", - }, - Class { - "body": Array [ - TraitUse { - "adaptations": Array [ - TraitPrecedence { - "instead": Array [ - Identifier { - "kind": "identifier", - "name": "A", - "resolution": "uqn", - }, - ], - "kind": "traitprecedence", - "method": "smallTalk", - "trait": Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - }, - TraitPrecedence { - "instead": Array [ - Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - Identifier { - "kind": "identifier", - "name": "C", - "resolution": "uqn", - }, - ], - "kind": "traitprecedence", - "method": "bigTalk", - "trait": Identifier { - "kind": "identifier", - "name": "A", - "resolution": "uqn", - }, - }, - TraitAlias { - "as": "talk", - "kind": "traitalias", - "method": "bigTalk", - "trait": Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - "visibility": "public", - }, - TraitAlias { - "as": "talk", - "kind": "traitalias", - "method": "bigTalk", - "trait": Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - "visibility": "protected", - }, - TraitAlias { - "as": "talk", - "kind": "traitalias", - "method": "bigTalk", - "trait": Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - "visibility": "private", - }, - TraitAlias { - "as": "list", - "kind": "traitalias", - "method": "new", - "trait": Identifier { - "kind": "identifier", - "name": "A", - "resolution": "uqn", - }, - "visibility": "", - }, - TraitAlias { - "as": "new", - "kind": "traitalias", - "method": "list", - "trait": null, - "visibility": "", - }, - ], - "kind": "traituse", - "traits": Array [ - Identifier { - "kind": "identifier", - "name": "A", - "resolution": "uqn", - }, - Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - ], - }, - Method { - "arguments": Array [], - "body": null, - "byref": true, - "isAbstract": true, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": "foo", - "nullable": false, - "type": Identifier { - "kind": "identifier", - "name": "bar", - "resolution": "uqn", - }, - "visibility": "protected", - }, - ], - "extends": null, - "implements": null, - "isAbstract": true, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "name": "bar", - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/comment.test.js.snap b/test/snapshot/__snapshots__/comment.test.js.snap deleted file mode 100644 index 9514263cb..000000000 --- a/test/snapshot/__snapshots__/comment.test.js.snap +++ /dev/null @@ -1,850 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test comments issues fix #55 1`] = ` -Program { - "children": Array [ - If { - "alternate": null, - "body": Block { - "children": Array [ - If { - "alternate": null, - "body": Block { - "children": Array [], - "kind": "block", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "// inner statements -", - }, - ], - }, - "kind": "if", - "shortForm": true, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "kind": "block", - }, - "kind": "if", - "shortForm": true, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "comments": Array [ - CommentLine { - "kind": "commentline", - "value": "// inner statements -", - }, - CommentLine { - "kind": "commentline", - "value": "// another comment -", - }, - CommentLine { - "kind": "commentline", - "value": "// 2nd comment -", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test comments issues fix #126 : new option 1`] = ` -Program { - "children": Array [ - If { - "alternate": If { - "alternate": null, - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "2", - }, - }, - ], - "kind": "block", - }, - "kind": "if", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "// Don't parsed :( -", - }, - ], - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - }, - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1", - }, - }, - ], - "kind": "block", - }, - "kind": "if", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "comments": Array [ - CommentLine { - "kind": "commentline", - "value": "// Don't parsed :( -", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test comments multi line comments test function 1`] = ` -Program { - "children": Array [ - _Function { - "arguments": Array [ - Parameter { - "byref": false, - "kind": "parameter", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* @var something */", - }, - ], - "name": "arg", - "nullable": false, - "type": null, - "value": null, - "variadic": false, - }, - ], - "body": Block { - "children": Array [ - Return { - "expr": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "arg", - }, - "kind": "return", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "// inner -", - }, - ], - }, - ], - "kind": "block", - }, - "byref": true, - "kind": "function", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/** - * Description - */", - }, - ], - "name": "name", - "nullable": false, - "type": null, - }, - ], - "comments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/** - * Description - */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* @var something */", - }, - CommentLine { - "kind": "commentline", - "value": "// inner -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test comments multi line comments test if statements 1`] = ` -Program { - "children": Array [ - If { - "alternate": If { - "alternate": If { - "alternate": Block { - "children": Array [], - "kind": "block", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - ], - }, - "body": Block { - "children": Array [], - "kind": "block", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - ], - }, - "kind": "if", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - ], - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - }, - "body": Block { - "children": Array [], - "kind": "block", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - ], - }, - "kind": "if", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "# inner statement -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentLine { - "kind": "commentline", - "value": "// else with a inner if single statement : -", - }, - ], - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - "body": Block { - "children": Array [], - "kind": "block", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - ], - }, - "kind": "if", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - If { - "alternate": null, - "body": Block { - "children": Array [], - "kind": "block", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - ], - }, - "kind": "if", - "shortForm": true, - "test": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - }, - ], - "comments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentLine { - "kind": "commentline", - "value": "# inner statement -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentLine { - "kind": "commentline", - "value": "// else with a inner if single statement : -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test comments multi line comments test try statements 1`] = ` -Program { - "children": Array [ - Try { - "always": Block { - "children": Array [], - "kind": "block", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ee */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* zz */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* yy */", - }, - ], - }, - "body": Block { - "children": Array [], - "kind": "block", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - ], - }, - "catches": Array [ - Catch { - "body": Block { - "children": Array [], - "kind": "block", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* dd */", - }, - ], - }, - "kind": "catch", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "# inner statement -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* dd */", - }, - ], - "variable": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* aa */", - }, - ], - "name": "e", - }, - "what": Array [ - Identifier { - "kind": "identifier", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* zz */", - }, - ], - "name": "\\\\Exception", - "resolution": "qn", - }, - Identifier { - "kind": "identifier", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* 1 */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* 2 */", - }, - ], - "name": "\\\\Foo", - "resolution": "qn", - }, - ], - }, - ], - "kind": "try", - }, - ], - "comments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentLine { - "kind": "commentline", - "value": "# inner statement -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* dd */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* zz */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* 1 */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* 2 */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* aa */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* bb */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* dd */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ee */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* zz */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* yy */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentLine { - "kind": "commentline", - "value": "// end -", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test comments test classes 1`] = ` -Program { - "children": Array [ - Class { - "body": Array [ - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "property", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* hehe */", - }, - CommentLine { - "kind": "commentline", - "value": "// @var test -", - }, - ], - "name": "test", - "value": null, - "visibility": "protected", - }, - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "property", - "name": "toto", - "value": null, - "visibility": "protected", - }, - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": true, - "kind": "property", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "// ignored comment -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/** @var Class */", - }, - ], - "name": "foo", - "value": Number { - "kind": "number", - "value": "123", - }, - "visibility": "public", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [], - "kind": "block", - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/** ignored also **/", - }, - CommentBlock { - "kind": "commentblock", - "value": "/** - * @return void - */", - }, - ], - "name": "void", - "nullable": false, - "type": null, - "visibility": "public", - }, - ], - "extends": null, - "implements": null, - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/** - * Description - */", - }, - ], - "name": "name", - }, - ], - "comments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/** - * Description - */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* ignore */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* hehe */", - }, - CommentLine { - "kind": "commentline", - "value": "// @var test -", - }, - CommentLine { - "kind": "commentline", - "value": "// ignored comment -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/** @var Class */", - }, - CommentBlock { - "kind": "commentblock", - "value": "/** ignored also **/", - }, - CommentBlock { - "kind": "commentblock", - "value": "/** - * @return void - */", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test comments test single line comments 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "123", - }, - }, - ], - "comments": Array [ - CommentLine { - "kind": "commentline", - "value": "# some information -", - }, - CommentLine { - "kind": "commentline", - "value": "// another line -", - }, - CommentLine { - "kind": "commentline", - "value": "// 123 -", - }, - CommentBlock { - "kind": "commentblock", - "value": "/* done */", - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/expr.test.js.snap b/test/snapshot/__snapshots__/expr.test.js.snap deleted file mode 100644 index 5b9b6d4f0..000000000 --- a/test/snapshot/__snapshots__/expr.test.js.snap +++ /dev/null @@ -1,1603 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test expressions should assign class static 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": StaticLookup { - "kind": "staticlookup", - "offset": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "what": Identifier { - "kind": "identifier", - "name": "a", - "resolution": "uqn", - }, - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions should fail to assign class constants 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "b", - }, - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1", - }, - }, - ], - "errors": Array [ - Error { - "expected": "VARIABLE", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '=' on line 1", - "token": "'='", - }, - ], - "kind": "program", -} -`; - -exports[`Test expressions should fail to assign constants 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "a", - "resolution": "uqn", - }, - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1", - }, - }, - ], - "errors": Array [ - Error { - "expected": "VARIABLE", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '=' on line 1", - "token": "'='", - }, - ], - "kind": "program", -} -`; - -exports[`Test expressions test assignements 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": ".=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "+=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "-=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "*=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "**=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "/=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "&=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "|=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "%=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "^=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "<<=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": ">>=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test binary 1`] = ` -Program { - "children": Array [ - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "|", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "&", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "^", - }, - Bin { - "kind": "bin", - "left": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"1\\"", - "unicode": false, - "value": "1", - }, - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"3\\"", - "unicode": false, - "value": "3", - }, - "type": ".", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "+", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "-", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "*", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "/", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "%", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "**", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "<<", - }, - Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": ">>", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test cast 1`] = ` -Program { - "children": Array [ - Cast { - "kind": "cast", - "raw": "(int)", - "type": "int", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(integer)", - "type": "int", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(bool)", - "type": "bool", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(boolean)", - "type": "bool", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(float)", - "type": "float", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(double)", - "type": "float", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(real)", - "type": "float", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(string)", - "type": "string", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(binary)", - "type": "binary", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(array)", - "type": "array", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(object)", - "type": "object", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Cast { - "kind": "cast", - "raw": "(unset)", - "type": "unset", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test cast extension - #171 1`] = ` -Program { - "children": Array [ - Variable { - "byref": false, - "cast": "int", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(int)", - }, - Variable { - "byref": false, - "cast": "int", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(integer)", - }, - Variable { - "byref": false, - "cast": "bool", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(bool)", - }, - Variable { - "byref": false, - "cast": "bool", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(boolean)", - }, - Variable { - "byref": false, - "cast": "float", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(float)", - }, - Variable { - "byref": false, - "cast": "float", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(double)", - }, - Variable { - "byref": false, - "cast": "float", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(real)", - }, - Variable { - "byref": false, - "cast": "string", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(string)", - }, - Variable { - "byref": false, - "cast": "binary", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(binary)", - }, - Variable { - "byref": false, - "cast": "array", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(array)", - }, - Variable { - "byref": false, - "cast": "object", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(object)", - }, - Variable { - "byref": false, - "cast": "unset", - "curly": false, - "kind": "variable", - "name": "var", - "rawCast": "(unset)", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test exit 1`] = ` -Program { - "children": Array [ - Exit { - "kind": "exit", - "status": Number { - "kind": "number", - "value": "1", - }, - "useDie": false, - }, - Exit { - "kind": "exit", - "status": null, - "useDie": true, - }, - Exit { - "kind": "exit", - "status": null, - "useDie": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test generators 1`] = ` -Program { - "children": Array [ - _Function { - "arguments": Array [], - "body": Block { - "children": Array [ - Yield { - "key": null, - "kind": "yield", - "value": Number { - "kind": "number", - "value": "0", - }, - }, - YieldFrom { - "kind": "yieldfrom", - "value": Call { - "arguments": Array [], - "kind": "call", - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - }, - Yield { - "key": Number { - "kind": "number", - "value": "1", - }, - "kind": "yield", - "value": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - ], - "kind": "block", - }, - "byref": false, - "kind": "function", - "name": "gen", - "nullable": false, - "type": null, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test if based returns 1`] = ` -Program { - "children": Array [ - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - "type": "??", - }, - RetIf { - "falseExpr": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - "kind": "retif", - "test": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Number { - "kind": "number", - "value": "5", - }, - "type": ">", - }, - "trueExpr": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - RetIf { - "falseExpr": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - "kind": "retif", - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "trueExpr": null, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test incr/decr 1`] = ` -Program { - "children": Array [ - Post { - "kind": "post", - "loc": Location { - "end": Position { - "column": 11, - "line": 2, - "offset": 12, - }, - "source": null, - "start": Position { - "column": 6, - "line": 2, - "offset": 7, - }, - }, - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 8, - "line": 2, - "offset": 9, - }, - "source": null, - "start": Position { - "column": 6, - "line": 2, - "offset": 7, - }, - }, - "name": "i", - }, - }, - Post { - "kind": "post", - "loc": Location { - "end": Position { - "column": 11, - "line": 3, - "offset": 24, - }, - "source": null, - "start": Position { - "column": 6, - "line": 3, - "offset": 19, - }, - }, - "type": "-", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 8, - "line": 3, - "offset": 21, - }, - "source": null, - "start": Position { - "column": 6, - "line": 3, - "offset": 19, - }, - }, - "name": "i", - }, - }, - Pre { - "kind": "pre", - "loc": Location { - "end": Position { - "column": 11, - "line": 4, - "offset": 36, - }, - "source": null, - "start": Position { - "column": 6, - "line": 4, - "offset": 31, - }, - }, - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 10, - "line": 4, - "offset": 35, - }, - "source": null, - "start": Position { - "column": 8, - "line": 4, - "offset": 33, - }, - }, - "name": "i", - }, - }, - Pre { - "kind": "pre", - "loc": Location { - "end": Position { - "column": 11, - "line": 5, - "offset": 48, - }, - "source": null, - "start": Position { - "column": 6, - "line": 5, - "offset": 43, - }, - }, - "type": "-", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 10, - "line": 5, - "offset": 47, - }, - "source": null, - "start": Position { - "column": 8, - "line": 5, - "offset": 45, - }, - }, - "name": "i", - }, - }, - ], - "errors": Array [], - "kind": "program", - "loc": Location { - "end": Position { - "column": 11, - "line": 5, - "offset": 48, - }, - "source": null, - "start": Position { - "column": 0, - "line": 1, - "offset": 0, - }, - }, -} -`; - -exports[`Test expressions test more binary ops (formerly bool) 1`] = ` -Program { - "children": Array [ - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "&&", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "and", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "||", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "or", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "xor", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "===", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "!==", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "==", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "!=", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": ">", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "<", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": ">=", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "<=", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "<=>", - }, - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "type": "instanceof", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test nested expressions precedence 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Bin { - "kind": "bin", - "left": Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "5", - }, - "right": Number { - "kind": "number", - "value": "2", - }, - "type": "*", - }, - "right": Number { - "kind": "number", - "value": "1", - }, - "type": "+", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "5", - }, - "right": Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "2", - }, - "parenthesizedExpression": true, - "right": Number { - "kind": "number", - "value": "1", - }, - "type": "+", - }, - "type": "*", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "c", - }, - "operator": "=", - "right": Bin { - "kind": "bin", - "left": Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "2", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "/", - }, - "type": "+", - }, - "right": Number { - "kind": "number", - "value": "4", - }, - "type": "+", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "d", - }, - "operator": "=", - "right": Bin { - "kind": "bin", - "left": Bin { - "kind": "bin", - "left": Number { - "kind": "number", - "value": "1", - }, - "right": Number { - "kind": "number", - "value": "2", - }, - "type": "!==", - }, - "right": Number { - "kind": "number", - "value": "3", - }, - "type": "&&", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test new 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": New { - "arguments": Array [], - "kind": "new", - "what": Identifier { - "kind": "identifier", - "name": "\\\\foo", - "resolution": "qn", - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": New { - "arguments": Array [], - "kind": "new", - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "class", - }, - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "rn", - }, - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": New { - "arguments": Array [], - "kind": "new", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": New { - "arguments": Array [], - "kind": "new", - "what": Class { - "body": Array [], - "extends": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - "implements": Array [ - Identifier { - "kind": "identifier", - "name": "bar", - "resolution": "uqn", - }, - ], - "isAbstract": false, - "isAnonymous": true, - "isFinal": false, - "kind": "class", - "name": null, - }, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test silent 1`] = ` -Program { - "children": Array [ - Silent { - "expr": Call { - "arguments": Array [], - "kind": "call", - "what": Identifier { - "kind": "identifier", - "name": "trigger_error", - "resolution": "uqn", - }, - }, - "kind": "silent", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test expressions test unary 1`] = ` -Program { - "children": Array [ - Unary { - "kind": "unary", - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Unary { - "kind": "unary", - "type": "~", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Unary { - "kind": "unary", - "type": "!", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Unary { - "kind": "unary", - "type": "-", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/function.test.js.snap b/test/snapshot/__snapshots__/function.test.js.snap deleted file mode 100644 index e6d9e9f59..000000000 --- a/test/snapshot/__snapshots__/function.test.js.snap +++ /dev/null @@ -1,302 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Function tests test function parsing 1`] = ` -Program { - "children": Array [ - _Function { - "arguments": Array [ - Parameter { - "byref": false, - "kind": "parameter", - "name": "a", - "nullable": false, - "type": null, - "value": Number { - "kind": "number", - "value": "1", - }, - "variadic": false, - }, - Parameter { - "byref": false, - "kind": "parameter", - "name": "b", - "nullable": false, - "type": Identifier { - "kind": "identifier", - "name": "\\\\callable", - "resolution": "fqn", - }, - "value": null, - "variadic": false, - }, - Parameter { - "byref": true, - "kind": "parameter", - "name": "params", - "nullable": true, - "type": Identifier { - "kind": "identifier", - "name": "\\\\array", - "resolution": "fqn", - }, - "value": null, - "variadic": true, - }, - ], - "body": Block { - "children": Array [], - "kind": "block", - }, - "byref": true, - "kind": "function", - "name": "foo", - "nullable": true, - "type": Identifier { - "kind": "identifier", - "name": "boolean", - "resolution": "uqn", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Closure { - "arguments": Array [ - Parameter { - "byref": false, - "kind": "parameter", - "name": "b", - "nullable": false, - "type": null, - "value": null, - "variadic": false, - }, - ], - "body": Block { - "children": Array [ - Return { - "expr": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - "kind": "return", - }, - ], - "kind": "block", - }, - "byref": true, - "isStatic": false, - "kind": "closure", - "nullable": false, - "type": Identifier { - "kind": "identifier", - "name": "\\\\array", - "resolution": "fqn", - }, - "uses": Array [ - Variable { - "byref": true, - "curly": false, - "kind": "variable", - "name": "c", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "d", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Call { - "arguments": Array [ - variadic { - "kind": "variadic", - "what": Array { - "items": Array [ - Number { - "kind": "number", - "value": "1", - }, - ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "null", - "resolution": "uqn", - }, - }, - Number { - "kind": "number", - "value": "1", - }, - Number { - "kind": "number", - "value": "2", - }, - Number { - "kind": "number", - "value": "3", - }, - ], - "kind": "array", - "shortForm": true, - }, - }, - ], - "kind": "call", - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Function tests test reserved word for function name error 1`] = ` -Program { - "children": Array [ - _Function { - "arguments": Array [], - "body": Block { - "children": Array [], - "kind": "block", - }, - "byref": false, - "kind": "function", - "name": false, - "nullable": false, - "type": null, - }, - ], - "errors": Array [ - Error { - "expected": 105, - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected 'list' (T_LIST), expecting T_STRING on line 1", - "token": "'list' (T_LIST)", - }, - ], - "kind": "program", -} -`; - -exports[`Function tests test static closure 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Closure { - "arguments": Array [], - "body": Block { - "children": Array [], - "kind": "block", - }, - "byref": false, - "isStatic": true, - "kind": "closure", - "nullable": false, - "type": null, - "uses": Array [], - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Function tests test variadic error 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Call { - "arguments": Array [ - variadic { - "kind": "variadic", - "what": Array { - "items": Array [ - Number { - "kind": "number", - "value": "1", - }, - Number { - "kind": "number", - "value": "2", - }, - Number { - "kind": "number", - "value": "3", - }, - ], - "kind": "array", - "shortForm": true, - }, - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - ], - "kind": "call", - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - }, - ], - "errors": Array [ - Error { - "expected": undefined, - "kind": "error", - "line": 1, - "message": "Unexpected argument after a variadic argument on line 1", - "token": undefined, - }, - ], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/graceful.test.js.snap b/test/snapshot/__snapshots__/graceful.test.js.snap deleted file mode 100644 index a586c9bc6..000000000 --- a/test/snapshot/__snapshots__/graceful.test.js.snap +++ /dev/null @@ -1,414 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test graceful mode to suppress errors should contain 2 errors 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - "operator": "=", - "right": Closure { - "arguments": Array [], - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - "operator": "=", - "right": undefined, - }, - ], - "kind": "block", - }, - "byref": false, - "isStatic": false, - "kind": "closure", - "nullable": false, - "type": null, - "uses": Array [], - }, - }, - ], - "errors": Array [ - Error { - "expected": "EXPR", - "kind": "error", - "line": 4, - "message": "Parse Error : syntax error, unexpected '}' on line 4", - "token": "'}'", - }, - Error { - "expected": ";", - "kind": "error", - "line": 5, - "message": "Parse Error : syntax error, unexpected '}', expecting ';' on line 5", - "token": "'}'", - }, - ], - "kind": "program", -} -`; - -exports[`Test graceful mode to suppress errors test class 1`] = ` -Program { - "children": Array [ - Class { - "body": Array [ - ClassConstant { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "classconstant", - "name": "A", - "value": Number { - "kind": "number", - "value": "1", - }, - "visibility": "", - }, - ], - "extends": null, - "implements": null, - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "name": "foo", - }, - ], - "errors": Array [ - Error { - "expected": Array [ - 198, - 222, - 182, - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected 'foo' (T_STRING) on line 1", - "token": "'foo' (T_STRING)", - }, - Error { - "expected": ";", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting ';' on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "}", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '}' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test graceful mode to suppress errors test expr 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "right": undefined, - "type": "-", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - "operator": "=", - "right": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - ], - "errors": Array [ - Error { - "expected": "EXPR", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected ';' on line 1", - "token": "';'", - }, - Error { - "expected": ";", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '$foo' (T_VARIABLE), expecting ';' on line 1", - "token": "'$foo' (T_VARIABLE)", - }, - ], - "kind": "program", -} -`; - -exports[`Test graceful mode to suppress errors test flags 1`] = ` -Program { - "children": Array [ - Interface { - "body": Array [ - Method { - "arguments": Array [], - "body": null, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": "func", - "nullable": false, - "type": null, - "visibility": "", - }, - ], - "extends": null, - "kind": "interface", - "name": "foo", - }, - ], - "errors": Array [ - Error { - "expected": 187, - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected 'final' (T_FINAL), expecting T_CLASS on line 2", - "token": "'final' (T_FINAL)", - }, - Error { - "expected": undefined, - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected 'abstract' (T_ABSTRACT) on line 3", - "token": "'abstract' (T_ABSTRACT)", - }, - Error { - "expected": ";", - "kind": "error", - "line": 4, - "message": "Parse Error : syntax error, expecting ';' on line 4", - "token": "the end of file (EOF)", - }, - Error { - "expected": "}", - "kind": "error", - "line": 4, - "message": "Parse Error : syntax error, expecting '}' on line 4", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test graceful mode to suppress errors test function arguments 1`] = ` -Program { - "children": Array [ - Call { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "arg", - }, - ], - "kind": "call", - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "bar", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - "operator": "=", - "right": New { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "baz", - }, - ], - "kind": "new", - "what": Identifier { - "kind": "identifier", - "name": "bar", - "resolution": "uqn", - }, - }, - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - ], - "errors": Array [ - Error { - "expected": "EXPR", - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected ')' on line 2", - "token": "')'", - }, - Error { - "expected": ")", - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected ';', expecting ')' on line 2", - "token": "';'", - }, - Error { - "expected": "EXPR", - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected ',' on line 3", - "token": "','", - }, - Error { - "expected": ")", - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected '$foo' (T_VARIABLE), expecting ')' on line 3", - "token": "'$foo' (T_VARIABLE)", - }, - Error { - "expected": ";", - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected '$foo' (T_VARIABLE), expecting ';' on line 3", - "token": "'$foo' (T_VARIABLE)", - }, - Error { - "expected": ";", - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected ')', expecting ';' on line 3", - "token": "')'", - }, - Error { - "expected": "EXPR", - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected ')' on line 3", - "token": "')'", - }, - ], - "kind": "program", -} -`; - -exports[`Test graceful mode to suppress errors test method chains 1`] = ` -Program { - "children": Array [ - PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "", - }, - "what": Call { - "arguments": Array [ - Call { - "arguments": Array [], - "kind": "call", - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "once", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "this", - }, - }, - }, - ], - "kind": "call", - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "expects", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "controller", - }, - }, - }, - }, - ], - "errors": Array [ - Error { - "expected": Array [ - 105, - 222, - ], - "kind": "error", - "line": 4, - "message": "Parse Error : syntax error on line 4", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/if.test.js.snap b/test/snapshot/__snapshots__/if.test.js.snap deleted file mode 100644 index de74fbb94..000000000 --- a/test/snapshot/__snapshots__/if.test.js.snap +++ /dev/null @@ -1,601 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test IF statements test common cases 1`] = ` -Program { - "children": Array [ - If { - "alternate": If { - "alternate": If { - "alternate": Block { - "children": Array [ - Echo { - "arguments": Array [ - String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"else\\"", - "unicode": false, - "value": "else", - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "kind": "block", - }, - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"2nd\\"", - "unicode": false, - "value": "2nd", - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "kind": "block", - }, - "kind": "if", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - }, - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"false\\"", - "unicode": false, - "value": "false", - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "kind": "block", - }, - "kind": "if", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - }, - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"is true\\"", - "unicode": false, - "value": "is true", - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "kind": "block", - }, - "kind": "if", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test IF statements test issue #84 1`] = ` -Program { - "children": Array [ - Inline { - "kind": "inline", - "raw": " - ", - "value": " - ", - }, - If { - "alternate": Block { - "children": Array [ - Inline { - "kind": "inline", - "raw": " - ", - "value": " ", - }, - ], - "kind": "block", - }, - "body": Block { - "children": Array [ - Inline { - "kind": "inline", - "raw": " - ", - "value": " ", - }, - ], - "kind": "block", - }, - "kind": "if", - "shortForm": true, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - Inline { - "kind": "inline", - "raw": " - ", - "value": " ", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test IF statements test issue #168 1`] = ` -Program { - "children": Array [ - If { - "alternate": null, - "body": null, - "kind": "if", - "loc": Location { - "end": Position { - "column": 16, - "line": 1, - "offset": 16, - }, - "source": "if ($foo);", - "start": Position { - "column": 6, - "line": 1, - "offset": 6, - }, - }, - "shortForm": false, - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 14, - "line": 1, - "offset": 14, - }, - "source": "$foo", - "start": Position { - "column": 10, - "line": 1, - "offset": 10, - }, - }, - "name": "foo", - }, - }, - Inline { - "kind": "inline", - "loc": Location { - "end": Position { - "column": 6, - "line": 2, - "offset": 26, - }, - "source": " ", - "start": Position { - "column": 0, - "line": 2, - "offset": 20, - }, - }, - "raw": " - ", - "value": " ", - }, - ], - "errors": Array [], - "kind": "program", - "loc": Location { - "end": Position { - "column": 6, - "line": 2, - "offset": 26, - }, - "source": " - ", - "start": Position { - "column": 0, - "line": 1, - "offset": 0, - }, - }, -} -`; - -exports[`Test IF statements test issue #168 2`] = ` -Program { - "children": Array [ - If { - "alternate": null, - "body": null, - "kind": "if", - "loc": Location { - "end": Position { - "column": 15, - "line": 1, - "offset": 15, - }, - "source": "if ($foo)", - "start": Position { - "column": 6, - "line": 1, - "offset": 6, - }, - }, - "shortForm": false, - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 14, - "line": 1, - "offset": 14, - }, - "source": "$foo", - "start": Position { - "column": 10, - "line": 1, - "offset": 10, - }, - }, - "name": "foo", - }, - }, - Inline { - "kind": "inline", - "loc": Location { - "end": Position { - "column": 6, - "line": 2, - "offset": 25, - }, - "source": " ", - "start": Position { - "column": 0, - "line": 2, - "offset": 19, - }, - }, - "raw": " - ", - "value": " ", - }, - ], - "errors": Array [], - "kind": "program", - "loc": Location { - "end": Position { - "column": 6, - "line": 2, - "offset": 25, - }, - "source": " - ", - "start": Position { - "column": 0, - "line": 1, - "offset": 0, - }, - }, -} -`; - -exports[`Test IF statements test issue #168 3`] = ` -Program { - "children": Array [ - If { - "alternate": null, - "body": null, - "kind": "if", - "loc": Location { - "end": Position { - "column": 7, - "line": 2, - "offset": 23, - }, - "source": "if ($foo) - ;", - "start": Position { - "column": 6, - "line": 1, - "offset": 6, - }, - }, - "shortForm": false, - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 14, - "line": 1, - "offset": 14, - }, - "source": "$foo", - "start": Position { - "column": 10, - "line": 1, - "offset": 10, - }, - }, - "name": "foo", - }, - }, - ], - "errors": Array [], - "kind": "program", - "loc": Location { - "end": Position { - "column": 7, - "line": 2, - "offset": 23, - }, - "source": "", - 1, - ], - Array [ - "T_WHITESPACE", - " ", - 1, - ], - Array [ - "T_STRING", - "list", - 1, - ], - ";", -] -`; - -exports[`Test lexer test comments 1`] = ` -Program { - "children": Array [ - Inline { - "kind": "inline", - "raw": " - ", - "value": " - ", - }, - Inline { - "kind": "inline", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "// simple comment ", - }, - ], - "raw": " - ", - "value": " ", - }, - Inline { - "kind": "inline", - "leadingComments": Array [ - CommentLine { - "kind": "commentline", - "value": "// another line ", - }, - ], - "raw": " - ", - "value": " ", - }, - Inline { - "kind": "inline", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "value": "/**/", - }, - ], - "raw": " - ", - "value": " ", - }, - ], - "comments": Array [ - CommentLine { - "kind": "commentline", - "value": "// simple comment ", - }, - CommentLine { - "kind": "commentline", - "value": "// another line ", - }, - CommentBlock { - "kind": "commentblock", - "value": "/**/", - }, - CommentLine { - "kind": "commentline", - "value": "// last comment -", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test lexer test tokens 1`] = ` -Array [ - Array [ - "T_OPEN_TAG", - " 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 8, - "line": 1, - "offset": 8, - }, - "source": "$a", - "start": Position { - "column": 6, - "line": 1, - "offset": 6, - }, - }, - "name": "a", - }, - "loc": Location { - "end": Position { - "column": 17, - "line": 1, - "offset": 17, - }, - "source": "$a = $b + 1", - "start": Position { - "column": 6, - "line": 1, - "offset": 6, - }, - }, - "operator": "=", - "right": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 13, - "line": 1, - "offset": 13, - }, - "source": "$b", - "start": Position { - "column": 11, - "line": 1, - "offset": 11, - }, - }, - "name": "b", - }, - "loc": Location { - "end": Position { - "column": 17, - "line": 1, - "offset": 17, - }, - "source": "$b + 1", - "start": Position { - "column": 11, - "line": 1, - "offset": 11, - }, - }, - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 17, - "line": 1, - "offset": 17, - }, - "source": "1", - "start": Position { - "column": 16, - "line": 1, - "offset": 16, - }, - }, - "value": "1", - }, - "type": "+", - }, - }, - ], - "errors": Array [], - "kind": "program", - "loc": Location { - "end": Position { - "column": 17, - "line": 1, - "offset": 17, - }, - "source": " $v -\\"", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "k", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -> ", - "unicode": false, - "value": " -> ", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "v", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -", - "unicode": false, - "value": " -", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "VARIABLE", - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected 'array' (T_ARRAY) on line 2", - "token": "'array' (T_ARRAY)", - }, - Error { - "expected": ")", - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected 'array' (T_ARRAY), expecting ')' on line 2", - "token": "'array' (T_ARRAY)", - }, - Error { - "expected": ";", - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected ')', expecting ';' on line 2", - "token": "')'", - }, - Error { - "expected": "EXPR", - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected ')' on line 2", - "token": "')'", - }, - Error { - "expected": ";", - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected 'echo' (T_ECHO), expecting ';' on line 3", - "token": "'echo' (T_ECHO)", - }, - ], - "kind": "program", -} -`; - -exports[`Test loops statements (for, while) fix #122 2`] = ` -Program { - "children": Array [ - Foreach { - "body": Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"$k -> $v -\\"", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "k", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -> ", - "unicode": false, - "value": " -> ", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "v", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -", - "unicode": false, - "value": " -", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - "key": List { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "bar", - }, - ], - "kind": "list", - "shortForm": true, - }, - "kind": "foreach", - "shortForm": false, - "source": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - "value": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - }, - ], - "errors": Array [ - Error { - "expected": undefined, - "kind": "error", - "line": 2, - "message": "Fatal Error : Cannot use list as key element on line 2", - "token": undefined, - }, - ], - "kind": "program", -} -`; - -exports[`Test loops statements (for, while) test do 1`] = ` -Program { - "children": Array [ - Do { - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"something\\"", - "unicode": false, - "value": "something", - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "kind": "block", - }, - "kind": "do", - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test loops statements (for, while) test for 1`] = ` -Program { - "children": Array [ - For { - "body": Echo { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "i", - }, - ], - "kind": "echo", - "shortForm": false, - }, - "increment": Array [ - Post { - "kind": "post", - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "i", - }, - }, - ], - "init": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "i", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "0", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "0", - }, - }, - ], - "kind": "for", - "shortForm": false, - "test": Array [ - Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "i", - }, - "right": Number { - "kind": "number", - "value": "10", - }, - "type": "<", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "ok", - }, - ], - }, - For { - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "ok", - }, - ], - "kind": "echo", - "shortForm": false, - }, - Continue { - "kind": "continue", - "level": Number { - "kind": "number", - "value": "5", - }, - }, - Continue { - "kind": "continue", - "level": Number { - "kind": "number", - "parenthesizedExpression": true, - "value": "5", - }, - }, - ], - "kind": "block", - }, - "increment": Array [], - "init": Array [], - "kind": "for", - "shortForm": true, - "test": Array [], - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test loops statements (for, while) test foreach 1`] = ` -Program { - "children": Array [ - Foreach { - "body": Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"$k -> $v -\\"", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "k", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -> ", - "unicode": false, - "value": " -> ", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "v", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -", - "unicode": false, - "value": " -", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - "key": null, - "kind": "foreach", - "shortForm": false, - "source": Variable { - "byref": true, - "curly": false, - "kind": "variable", - "name": "foo", - }, - "value": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "v", - }, - }, - Foreach { - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"$a -> $b -\\"", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -> ", - "unicode": false, - "value": " -> ", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -", - "unicode": false, - "value": " -", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "kind": "block", - }, - "key": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "kind": "foreach", - "shortForm": true, - "source": Array { - "items": Array [ - Array { - "items": Array [ - Number { - "kind": "number", - "value": "1", - }, - Number { - "kind": "number", - "value": "2", - }, - ], - "kind": "array", - "shortForm": true, - }, - Array { - "items": Array [ - Number { - "kind": "number", - "value": "3", - }, - Number { - "kind": "number", - "value": "4", - }, - ], - "kind": "array", - "shortForm": true, - }, - ], - "kind": "array", - "shortForm": true, - }, - "value": List { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "c", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "d", - }, - ], - "kind": "list", - "shortForm": true, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test loops statements (for, while) test while test default form 1`] = ` -Program { - "children": Array [ - While { - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"go\\"", - "unicode": false, - "value": "go", - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "kind": "block", - }, - "kind": "while", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test loops statements (for, while) test while test short form 1`] = ` -Program { - "children": Array [ - While { - "body": Block { - "children": Array [ - Echo { - "arguments": Array [ - String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"short\\"", - "unicode": false, - "value": "short", - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "kind": "block", - }, - "kind": "while", - "shortForm": true, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/namespace.test.js.snap b/test/snapshot/__snapshots__/namespace.test.js.snap deleted file mode 100644 index 72186b1b0..000000000 --- a/test/snapshot/__snapshots__/namespace.test.js.snap +++ /dev/null @@ -1,1222 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test namespace statements check silent mode 1`] = ` -Program { - "children": Array [ - Namespace { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - "operator": "=", - "right": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "kind": "namespace", - "name": Identifier { - "kind": "identifier", - "name": "", - "resolution": "qn", - }, - "withBrackets": false, - }, - ], - "errors": Array [ - Error { - "expected": 105, - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected '$var' (T_VARIABLE), expecting T_STRING on line 2", - "token": "'$var' (T_VARIABLE)", - }, - Error { - "expected": Array [ - "{", - ";", - ], - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected '$var' (T_VARIABLE) on line 2", - "token": "'$var' (T_VARIABLE)", - }, - ], - "kind": "program", -} -`; - -exports[`Test namespace statements read usegroup location correctly with docs 1`] = ` -Program { - "children": Array [ - Namespace { - "children": Array [ - UseGroup { - "items": Array [ - UseItem { - "alias": null, - "kind": "useitem", - "loc": Location { - "end": Position { - "column": 25, - "line": 4, - "offset": 59, - }, - "source": null, - "start": Position { - "column": 10, - "line": 4, - "offset": 44, - }, - }, - "name": "Some\\\\other\\\\test", - "type": null, - }, - ], - "kind": "usegroup", - "loc": Location { - "end": Position { - "column": 25, - "line": 4, - "offset": 59, - }, - "source": null, - "start": Position { - "column": 6, - "line": 4, - "offset": 40, - }, - }, - "name": null, - "type": null, - }, - Class { - "body": Array [ - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "property", - "loc": Location { - "end": Position { - "column": 20, - "line": 10, - "offset": 189, - }, - "source": null, - "start": Position { - "column": 15, - "line": 10, - "offset": 184, - }, - }, - "name": "test", - "value": null, - "visibility": "public", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [ - Return { - "expr": Boolean { - "kind": "boolean", - "loc": Location { - "end": Position { - "column": 21, - "line": 13, - "offset": 239, - }, - "source": null, - "start": Position { - "column": 17, - "line": 13, - "offset": 235, - }, - }, - "raw": "true", - "value": true, - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 22, - "line": 13, - "offset": 240, - }, - "source": null, - "start": Position { - "column": 10, - "line": 13, - "offset": 228, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 9, - "line": 14, - "offset": 250, - }, - "source": null, - "start": Position { - "column": 24, - "line": 12, - "offset": 216, - }, - }, - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "loc": Location { - "end": Position { - "column": 9, - "line": 14, - "offset": 250, - }, - "source": null, - "start": Position { - "column": 8, - "line": 12, - "offset": 200, - }, - }, - "name": "test", - "nullable": false, - "type": null, - "visibility": "", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 12, - "line": 17, - "offset": 313, - }, - "source": null, - "start": Position { - "column": 10, - "line": 17, - "offset": 311, - }, - }, - "name": "a", - }, - "loc": Location { - "end": Position { - "column": 17, - "line": 17, - "offset": 318, - }, - "source": null, - "start": Position { - "column": 10, - "line": 17, - "offset": 311, - }, - }, - "operator": "=", - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 16, - "line": 17, - "offset": 317, - }, - "source": null, - "start": Position { - "column": 15, - "line": 17, - "offset": 316, - }, - }, - "value": "1", - }, - }, - Return { - "expr": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 19, - "line": 18, - "offset": 338, - }, - "source": null, - "start": Position { - "column": 17, - "line": 18, - "offset": 336, - }, - }, - "name": "a", - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 20, - "line": 18, - "offset": 339, - }, - "source": null, - "start": Position { - "column": 10, - "line": 18, - "offset": 329, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 9, - "line": 19, - "offset": 349, - }, - "source": null, - "start": Position { - "column": 47, - "line": 16, - "offset": 299, - }, - }, - }, - "byref": true, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "loc": Location { - "end": Position { - "column": 9, - "line": 19, - "offset": 349, - }, - "source": null, - "start": Position { - "column": 15, - "line": 16, - "offset": 267, - }, - }, - "name": "passByReferenceTest", - "nullable": false, - "type": null, - "visibility": "public", - }, - ], - "extends": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 27, - "line": 9, - "offset": 145, - }, - "source": null, - "start": Position { - "column": 24, - "line": 9, - "offset": 142, - }, - }, - "name": "Bar", - "resolution": "uqn", - }, - "implements": Array [ - Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 42, - "line": 9, - "offset": 160, - }, - "source": null, - "start": Position { - "column": 39, - "line": 9, - "offset": 157, - }, - }, - "name": "Baz", - "resolution": "uqn", - }, - Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 48, - "line": 9, - "offset": 166, - }, - "source": null, - "start": Position { - "column": 44, - "line": 9, - "offset": 162, - }, - }, - "name": "Buzz", - "resolution": "uqn", - }, - ], - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "leadingComments": Array [ - CommentBlock { - "kind": "commentblock", - "loc": Location { - "end": Position { - "column": 9, - "line": 8, - "offset": 117, - }, - "source": null, - "start": Position { - "column": 6, - "line": 6, - "offset": 68, - }, - }, - "value": "/** - * @property \\\\Test\\\\test $test - */", - }, - ], - "loc": Location { - "end": Position { - "column": 7, - "line": 20, - "offset": 357, - }, - "source": null, - "start": Position { - "column": 6, - "line": 9, - "offset": 124, - }, - }, - "name": "Foo", - }, - ], - "kind": "namespace", - "loc": Location { - "end": Position { - "column": 7, - "line": 20, - "offset": 357, - }, - "source": null, - "start": Position { - "column": 6, - "line": 2, - "offset": 7, - }, - }, - "name": "Test\\\\test\\\\test", - "withBrackets": false, - }, - ], - "comments": Array [ - CommentBlock { - "kind": "commentblock", - "loc": Location { - "end": Position { - "column": 9, - "line": 8, - "offset": 117, - }, - "source": null, - "start": Position { - "column": 6, - "line": 6, - "offset": 68, - }, - }, - "value": "/** - * @property \\\\Test\\\\test $test - */", - }, - ], - "errors": Array [], - "kind": "program", - "loc": Location { - "end": Position { - "column": 7, - "line": 20, - "offset": 357, - }, - "source": null, - "start": Position { - "column": 0, - "line": 1, - "offset": 0, - }, - }, -} -`; - -exports[`Test namespace statements read usegroup location correctly without docs 1`] = ` -Program { - "children": Array [ - Namespace { - "children": Array [ - UseGroup { - "items": Array [ - UseItem { - "alias": null, - "kind": "useitem", - "loc": Location { - "end": Position { - "column": 25, - "line": 4, - "offset": 59, - }, - "source": null, - "start": Position { - "column": 10, - "line": 4, - "offset": 44, - }, - }, - "name": "Some\\\\other\\\\test", - "type": null, - }, - ], - "kind": "usegroup", - "loc": Location { - "end": Position { - "column": 25, - "line": 4, - "offset": 59, - }, - "source": null, - "start": Position { - "column": 6, - "line": 4, - "offset": 40, - }, - }, - "name": null, - "type": null, - }, - Class { - "body": Array [ - Property { - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "property", - "loc": Location { - "end": Position { - "column": 20, - "line": 10, - "offset": 189, - }, - "source": null, - "start": Position { - "column": 15, - "line": 10, - "offset": 184, - }, - }, - "name": "test", - "value": null, - "visibility": "public", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [ - Return { - "expr": Boolean { - "kind": "boolean", - "loc": Location { - "end": Position { - "column": 21, - "line": 13, - "offset": 239, - }, - "source": null, - "start": Position { - "column": 17, - "line": 13, - "offset": 235, - }, - }, - "raw": "true", - "value": true, - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 22, - "line": 13, - "offset": 240, - }, - "source": null, - "start": Position { - "column": 10, - "line": 13, - "offset": 228, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 9, - "line": 14, - "offset": 250, - }, - "source": null, - "start": Position { - "column": 24, - "line": 12, - "offset": 216, - }, - }, - }, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "loc": Location { - "end": Position { - "column": 9, - "line": 14, - "offset": 250, - }, - "source": null, - "start": Position { - "column": 8, - "line": 12, - "offset": 200, - }, - }, - "name": "test", - "nullable": false, - "type": null, - "visibility": "", - }, - Method { - "arguments": Array [], - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 12, - "line": 17, - "offset": 313, - }, - "source": null, - "start": Position { - "column": 10, - "line": 17, - "offset": 311, - }, - }, - "name": "a", - }, - "loc": Location { - "end": Position { - "column": 17, - "line": 17, - "offset": 318, - }, - "source": null, - "start": Position { - "column": 10, - "line": 17, - "offset": 311, - }, - }, - "operator": "=", - "right": Number { - "kind": "number", - "loc": Location { - "end": Position { - "column": 16, - "line": 17, - "offset": 317, - }, - "source": null, - "start": Position { - "column": 15, - "line": 17, - "offset": 316, - }, - }, - "value": "1", - }, - }, - Return { - "expr": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "loc": Location { - "end": Position { - "column": 19, - "line": 18, - "offset": 338, - }, - "source": null, - "start": Position { - "column": 17, - "line": 18, - "offset": 336, - }, - }, - "name": "a", - }, - "kind": "return", - "loc": Location { - "end": Position { - "column": 20, - "line": 18, - "offset": 339, - }, - "source": null, - "start": Position { - "column": 10, - "line": 18, - "offset": 329, - }, - }, - }, - ], - "kind": "block", - "loc": Location { - "end": Position { - "column": 9, - "line": 19, - "offset": 349, - }, - "source": null, - "start": Position { - "column": 47, - "line": 16, - "offset": 299, - }, - }, - }, - "byref": true, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "loc": Location { - "end": Position { - "column": 9, - "line": 19, - "offset": 349, - }, - "source": null, - "start": Position { - "column": 15, - "line": 16, - "offset": 267, - }, - }, - "name": "passByReferenceTest", - "nullable": false, - "type": null, - "visibility": "public", - }, - ], - "extends": Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 27, - "line": 9, - "offset": 145, - }, - "source": null, - "start": Position { - "column": 24, - "line": 9, - "offset": 142, - }, - }, - "name": "Bar", - "resolution": "uqn", - }, - "implements": Array [ - Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 42, - "line": 9, - "offset": 160, - }, - "source": null, - "start": Position { - "column": 39, - "line": 9, - "offset": 157, - }, - }, - "name": "Baz", - "resolution": "uqn", - }, - Identifier { - "kind": "identifier", - "loc": Location { - "end": Position { - "column": 48, - "line": 9, - "offset": 166, - }, - "source": null, - "start": Position { - "column": 44, - "line": 9, - "offset": 162, - }, - }, - "name": "Buzz", - "resolution": "uqn", - }, - ], - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "loc": Location { - "end": Position { - "column": 7, - "line": 20, - "offset": 357, - }, - "source": null, - "start": Position { - "column": 6, - "line": 9, - "offset": 124, - }, - }, - "name": "Foo", - }, - ], - "kind": "namespace", - "loc": Location { - "end": Position { - "column": 7, - "line": 20, - "offset": 357, - }, - "source": null, - "start": Position { - "column": 6, - "line": 2, - "offset": 7, - }, - }, - "name": "Test\\\\test\\\\test", - "withBrackets": false, - }, - ], - "errors": Array [], - "kind": "program", - "loc": Location { - "end": Position { - "column": 7, - "line": 20, - "offset": 357, - }, - "source": null, - "start": Position { - "column": 0, - "line": 1, - "offset": 0, - }, - }, -} -`; - -exports[`Test namespace statements test multiple namespace 1`] = ` -Program { - "children": Array [ - Namespace { - "children": Array [ - Post { - "kind": "post", - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "i", - }, - }, - ], - "kind": "namespace", - "name": "\\\\foo", - "withBrackets": true, - }, - Namespace { - "children": Array [ - Post { - "kind": "post", - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - ], - "kind": "namespace", - "name": Array [ - "", - ], - "withBrackets": true, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test namespace statements test namespace error 1`] = ` -Program { - "children": Array [ - Namespace { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - "operator": "=", - "right": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "kind": "namespace", - "name": Identifier { - "kind": "identifier", - "name": "", - "resolution": "qn", - }, - "withBrackets": false, - }, - ], - "errors": Array [ - Error { - "expected": 105, - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected '$var' (T_VARIABLE), expecting T_STRING on line 2", - "token": "'$var' (T_VARIABLE)", - }, - Error { - "expected": Array [ - "{", - ";", - ], - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected '$var' (T_VARIABLE) on line 2", - "token": "'$var' (T_VARIABLE)", - }, - ], - "kind": "program", -} -`; - -exports[`Test namespace statements test namespace keyword 1`] = ` -Program { - "children": Array [ - Call { - "arguments": Array [], - "kind": "call", - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "rn", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - "operator": "=", - "right": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "bar", - "resolution": "rn", - }, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test namespace statements test single namespace 1`] = ` -Program { - "children": Array [ - Namespace { - "children": Array [ - UseGroup { - "items": Array [ - UseItem { - "alias": "barBaz", - "kind": "useitem", - "name": "bar\\\\baz", - "type": null, - }, - ], - "kind": "usegroup", - "name": null, - "type": null, - }, - UseGroup { - "items": Array [ - UseItem { - "alias": "barBaz", - "kind": "useitem", - "name": "bar\\\\baz", - "type": null, - }, - UseItem { - "alias": "bazBoo", - "kind": "useitem", - "name": "baz\\\\boo", - "type": null, - }, - ], - "kind": "usegroup", - "name": null, - "type": "const", - }, - UseGroup { - "items": Array [ - UseItem { - "alias": "barBaz", - "kind": "useitem", - "name": "bar\\\\baz", - "type": null, - }, - UseItem { - "alias": "bazBoo", - "kind": "useitem", - "name": "baz\\\\boo", - "type": null, - }, - ], - "kind": "usegroup", - "name": null, - "type": "function", - }, - UseGroup { - "items": Array [ - UseItem { - "alias": "BAZ_FOO", - "kind": "useitem", - "name": "FOO", - "type": "const", - }, - UseItem { - "alias": "BAZ_BOO", - "kind": "useitem", - "name": "BOO", - "type": "function", - }, - ], - "kind": "usegroup", - "name": "bar\\\\baz", - "type": null, - }, - UseGroup { - "items": Array [ - UseItem { - "alias": "AZERTY_A", - "kind": "useitem", - "name": "A", - "type": null, - }, - UseItem { - "alias": "AZERTY_B", - "kind": "useitem", - "name": "B", - "type": null, - }, - ], - "kind": "usegroup", - "name": "azerty", - "type": "const", - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "barBaz", - "resolution": "rn", - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "\\\\barBaz", - "resolution": "qn", - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "c", - }, - "operator": "=", - "right": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "barBaz\\\\foo", - "resolution": "qn", - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "d", - }, - "operator": "=", - "right": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "barBaz", - "resolution": "uqn", - }, - }, - }, - ], - "kind": "namespace", - "name": "foo", - "withBrackets": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test namespace statements work with declare statement 1`] = ` -Program { - "children": Array [ - Declare { - "children": Array [], - "kind": "declare", - "mode": "none", - "what": Object { - "strict_types": Number { - "kind": "number", - "value": "1", - }, - }, - }, - Namespace { - "children": Array [ - Class { - "body": Array [], - "extends": null, - "implements": null, - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "name": "bar", - }, - ], - "kind": "namespace", - "name": "foo", - "withBrackets": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/number.test.js.snap b/test/snapshot/__snapshots__/number.test.js.snap deleted file mode 100644 index 33014fb64..000000000 --- a/test/snapshot/__snapshots__/number.test.js.snap +++ /dev/null @@ -1,302 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test numbers test common cases 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "-1.5", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1234", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "c", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "9223372036854775807", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "c", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "9223372036854775808", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "d", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "0x1A", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "d", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "0xFF", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "e", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "0b1011", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "f", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "0123", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "g", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1.2e3", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "h", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "7E-10", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test numbers test edge cases 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "0", - }, - }, - ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "xx", - "resolution": "uqn", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "0", - }, - }, - ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "b2", - "resolution": "uqn", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "c", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "01239", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "d", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "7", - }, - }, - Bin { - "kind": "bin", - "left": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "E", - "resolution": "uqn", - }, - }, - "right": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "a", - "resolution": "uqn", - }, - }, - "type": "-", - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "e", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "7", - }, - }, - ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "EX", - "resolution": "uqn", - }, - }, - ], - "errors": Array [ - Error { - "expected": ";", - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected 'xx' (T_STRING), expecting ';' on line 2", - "token": "'xx' (T_STRING)", - }, - Error { - "expected": ";", - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected 'b2' (T_STRING), expecting ';' on line 3", - "token": "'b2' (T_STRING)", - }, - Error { - "expected": ";", - "kind": "error", - "line": 5, - "message": "Parse Error : syntax error, unexpected 'E' (T_STRING), expecting ';' on line 5", - "token": "'E' (T_STRING)", - }, - Error { - "expected": ";", - "kind": "error", - "line": 6, - "message": "Parse Error : syntax error, unexpected 'EX' (T_STRING), expecting ';' on line 6", - "token": "'EX' (T_STRING)", - }, - ], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/php5.test.js.snap b/test/snapshot/__snapshots__/php5.test.js.snap deleted file mode 100644 index 03d95bdd7..000000000 --- a/test/snapshot/__snapshots__/php5.test.js.snap +++ /dev/null @@ -1,141 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test syntax parsing without PHP7 support special keywords should fail 1`] = ` -Program { - "children": Array [ - Class { - "body": Array [ - Method { - "arguments": Array [ - Parameter { - "byref": false, - "kind": "parameter", - "name": null, - "nullable": false, - "type": null, - "value": null, - "variadic": false, - }, - ], - "body": null, - "byref": false, - "isAbstract": false, - "isFinal": false, - "isStatic": false, - "kind": "method", - "name": false, - "nullable": false, - "type": null, - "visibility": "", - }, - ], - "extends": null, - "implements": null, - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "name": "foo", - }, - ], - "errors": Array [ - Error { - "expected": "IDENTIFIER", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected 'list' (T_LIST) on line 1", - "token": "'list' (T_LIST)", - }, - Error { - "expected": "(", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected 'list' (T_LIST), expecting '(' on line 1", - "token": "'list' (T_LIST)", - }, - Error { - "expected": 222, - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected 'list' (T_LIST), expecting T_VARIABLE on line 1", - "token": "'list' (T_LIST)", - }, - Error { - "expected": Array [ - ",", - ")", - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected 'list' (T_LIST) on line 1", - "token": "'list' (T_LIST)", - }, - Error { - "expected": ")", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected 'list' (T_LIST), expecting ')' on line 1", - "token": "'list' (T_LIST)", - }, - Error { - "expected": "{", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected 'list' (T_LIST), expecting '{' on line 1", - "token": "'list' (T_LIST)", - }, - Error { - "expected": Array [ - 198, - 222, - 182, - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected 'list' (T_LIST) on line 1", - "token": "'list' (T_LIST)", - }, - Error { - "expected": Array [ - 198, - 222, - 182, - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '(' on line 1", - "token": "'('", - }, - Error { - "expected": Array [ - 198, - 222, - 182, - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected ')' on line 1", - "token": "')'", - }, - Error { - "expected": Array [ - 198, - 222, - 182, - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '{' on line 1", - "token": "'{'", - }, - Error { - "expected": "EXPR", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '}' on line 1", - "token": "'}'", - }, - ], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/scalar.test.js.snap b/test/snapshot/__snapshots__/scalar.test.js.snap deleted file mode 100644 index 70d3a6a37..000000000 --- a/test/snapshot/__snapshots__/scalar.test.js.snap +++ /dev/null @@ -1,207 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test scalar statements test constants 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "-5", - }, - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "ref", - }, - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test scalar statements test dereferencable 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "test", - }, - "what": OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "5", - }, - "what": Call { - "arguments": Array [], - "kind": "call", - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "bar", - }, - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - }, - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Call { - "arguments": Array [], - "kind": "call", - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": New { - "arguments": Array [], - "kind": "new", - "parenthesizedExpression": true, - "what": Identifier { - "kind": "identifier", - "name": "test", - "resolution": "uqn", - }, - }, - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "c", - }, - "operator": "=", - "right": OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "5", - }, - "what": Call { - "arguments": Array [], - "kind": "call", - "parenthesizedExpression": true, - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "d", - }, - "operator": "=", - "right": Call { - "arguments": Array [ - Number { - "kind": "number", - "value": "5", - }, - ], - "kind": "call", - "what": Closure { - "arguments": Array [ - Parameter { - "byref": false, - "kind": "parameter", - "name": "a", - "nullable": false, - "type": null, - "value": null, - "variadic": false, - }, - ], - "body": Block { - "children": Array [ - Return { - "expr": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": Number { - "kind": "number", - "value": "2", - }, - "type": "*", - }, - "kind": "return", - }, - ], - "kind": "block", - }, - "byref": false, - "isStatic": false, - "kind": "closure", - "nullable": false, - "parenthesizedExpression": true, - "type": null, - "uses": Array [], - }, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/statement.test.js.snap b/test/snapshot/__snapshots__/statement.test.js.snap deleted file mode 100644 index b59821057..000000000 --- a/test/snapshot/__snapshots__/statement.test.js.snap +++ /dev/null @@ -1,554 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test statements halt statements test fallback 1`] = ` -Program { - "children": Array [ - If { - "alternate": null, - "body": Block { - "children": Array [ - Halt { - "after": " - } - $b = 1; - ", - "kind": "halt", - }, - ], - "kind": "block", - }, - "kind": "if", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1", - }, - }, - ], - "errors": Array [ - Error { - "expected": undefined, - "kind": "error", - "line": 3, - "message": "__HALT_COMPILER() can only be used from the outermost scope on line 3", - "token": undefined, - }, - ], - "kind": "program", -} -`; - -exports[`Test statements halt statements test halt statement 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1", - }, - }, - Halt { - "after": " - $b = 1; - ", - "kind": "halt", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test statements test declare 1`] = ` -Program { - "children": Array [ - If { - "alternate": null, - "body": Block { - "children": Array [ - Declare { - "children": Array [], - "kind": "declare", - "mode": "none", - "what": Object { - "ticks": Number { - "kind": "number", - "value": "1", - }, - }, - }, - ], - "kind": "block", - }, - "kind": "if", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1", - }, - }, - Declare { - "children": Array [], - "kind": "declare", - "mode": "none", - "what": Object { - "encoding": Bin { - "kind": "bin", - "left": Bin { - "kind": "bin", - "left": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "ISO", - "resolution": "uqn", - }, - }, - "right": Number { - "kind": "number", - "value": "8859", - }, - "type": "-", - }, - "right": Number { - "kind": "number", - "value": "1", - }, - "type": "-", - }, - "ticks": Number { - "kind": "number", - "value": "2", - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "1", - }, - }, - Declare { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "c", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "2", - }, - }, - ], - "kind": "declare", - "mode": "block", - "what": Object { - "ticks": Number { - "kind": "number", - "value": "1", - }, - }, - }, - Declare { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "d", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "3", - }, - }, - ], - "kind": "declare", - "mode": "short", - "what": Object { - "encoding": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"UTF-8\\"", - "unicode": false, - "value": "UTF-8", - }, - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "e", - }, - "operator": "=", - "right": Number { - "kind": "number", - "value": "4", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test statements test global 1`] = ` -Program { - "children": Array [ - _Function { - "arguments": Array [], - "body": Block { - "children": Array [ - Global { - "items": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - ], - "kind": "global", - }, - ], - "kind": "block", - }, - "byref": false, - "kind": "function", - "name": "foo", - "nullable": false, - "type": null, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test statements test goto label 1`] = ` -Program { - "children": Array [ - Label { - "kind": "label", - "name": "start", - }, - Post { - "kind": "post", - "type": "+", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "i", - }, - }, - Goto { - "kind": "goto", - "label": "start", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test statements test inner statements 1`] = ` -Program { - "children": Array [ - If { - "alternate": null, - "body": Block { - "children": Array [ - _Function { - "arguments": Array [], - "body": Block { - "children": Array [], - "kind": "block", - }, - "byref": false, - "kind": "function", - "name": "foo", - "nullable": false, - "type": null, - }, - Class { - "body": Array [], - "extends": null, - "implements": null, - "isAbstract": true, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "name": "foo", - }, - Class { - "body": Array [], - "extends": null, - "implements": null, - "isAbstract": false, - "isAnonymous": false, - "isFinal": true, - "kind": "class", - "name": "foo", - }, - Class { - "body": Array [], - "extends": null, - "implements": null, - "isAbstract": false, - "isAnonymous": false, - "isFinal": false, - "kind": "class", - "name": "foo", - }, - Trait { - "body": Array [], - "extends": null, - "implements": null, - "kind": "trait", - "name": "foo", - }, - Interface { - "body": Array [], - "extends": null, - "kind": "interface", - "name": "foo", - }, - ], - "kind": "block", - }, - "kind": "if", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test statements test static 1`] = ` -Program { - "children": Array [ - _Function { - "arguments": Array [], - "body": Block { - "children": Array [ - Static { - "items": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": null, - "right": Number { - "kind": "number", - "value": "5", - }, - }, - ], - "kind": "static", - }, - ], - "kind": "block", - }, - "byref": false, - "kind": "function", - "name": "foo", - "nullable": false, - "type": null, - }, - Static { - "items": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "sVar1", - }, - "operator": null, - "right": Number { - "kind": "number", - "value": "11", - }, - }, - ], - "kind": "static", - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test statements test try 1`] = ` -Program { - "children": Array [ - Try { - "always": Block { - "children": Array [ - Call { - "arguments": Array [], - "kind": "call", - "what": Identifier { - "kind": "identifier", - "name": "clean", - "resolution": "uqn", - }, - }, - ], - "kind": "block", - }, - "body": Block { - "children": Array [ - Call { - "arguments": Array [], - "kind": "call", - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - ], - "kind": "block", - }, - "catches": Array [ - Catch { - "body": Block { - "children": Array [ - Call { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "err", - }, - ], - "kind": "call", - "what": Identifier { - "kind": "identifier", - "name": "var_dump", - "resolution": "uqn", - }, - }, - Throw { - "kind": "throw", - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "err", - }, - }, - ], - "kind": "block", - }, - "kind": "catch", - "variable": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "err", - }, - "what": Array [ - Identifier { - "kind": "identifier", - "name": "FooError", - "resolution": "uqn", - }, - Identifier { - "kind": "identifier", - "name": "BarError", - "resolution": "uqn", - }, - ], - }, - ], - "kind": "try", - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/string.test.js.snap b/test/snapshot/__snapshots__/string.test.js.snap deleted file mode 100644 index ad1bb6fb1..000000000 --- a/test/snapshot/__snapshots__/string.test.js.snap +++ /dev/null @@ -1,2076 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test strings binary cast 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Cast { - "kind": "cast", - "type": "string", - "what": Encapsed { - "kind": "encapsed", - "raw": "\\"\\\\colors[1] contains >$colors[1]<\\\\n\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "\\\\colors[1] contains >", - "value": "\\\\colors[1] contains >", - }, - OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "1", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "colors", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "<\\\\n", - "value": "< -", - }, - ], - }, - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings check infinite on $ using backquotes 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\`$", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "$", - "unicode": false, - "value": "$", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "\`", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\`' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on $ using doublequotes 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"$", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "$", - "unicode": false, - "value": "$", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "\\"", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\\"' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on $ with arrow 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\` -> $", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -> $", - "unicode": false, - "value": " -> $", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "\`", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\`' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on \${ using backquotes 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\`\${", - "type": "shell", - "value": Array [ - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": undefined, - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "EXPR", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "}", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '}' on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "\`", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\`' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on \${ using doublequotes 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"\${", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": undefined, - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "EXPR", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "}", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '}' on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "\\"", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\\"' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on \${ with arrow 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\` -> \${", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -> ", - "unicode": false, - "value": " -> ", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": undefined, - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "EXPR", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "}", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '}' on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "\`", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\`' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on { using backquotes 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\`{", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "{", - "unicode": false, - "value": "{", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "\`", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\`' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on { using doublequotes 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"{", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "{", - "unicode": false, - "value": "{", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "\\"", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\\"' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on { with arrow 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\` -> {", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -> {", - "unicode": false, - "value": " -> {", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": "\`", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\`' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on {$ using backquotes 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\`{$", - "type": "shell", - "value": Array [ - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": "", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": Array [ - "{", - "$", - 222, - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "}", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '}' on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "\`", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\`' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on {$ using doublequotes 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"{$", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": "", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": Array [ - "{", - "$", - 222, - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "}", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '}' on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "\\"", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\\"' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings check infinite on {$ with arrow 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\` -> {$", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -> ", - "unicode": false, - "value": " -> ", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": "", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": Array [ - "{", - "$", - 222, - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "}", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '}' on line 1", - "token": "the end of file (EOF)", - }, - Error { - "expected": "\`", - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, expecting '\`' on line 1", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings encapsed variable / curly constant 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"Hello \${ obj }\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "Hello ", - "unicode": false, - "value": "Hello ", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "obj", - "resolution": "uqn", - }, - }, - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings encapsed variable / curly varname 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"Hello \${obj}->name !\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "Hello ", - "unicode": false, - "value": "Hello ", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": ConstRef { - "kind": "constref", - "name": "obj", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "->name !", - "unicode": false, - "value": "->name !", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings encapsed variable / offsetlookup 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"\${$parts[$i]}\\\\n\\"", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": OffsetLookup { - "kind": "offsetlookup", - "offset": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "i", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "parts", - }, - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "\\\\n", - "unicode": false, - "value": " -", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings fix #101 case 1 1`] = ` -Program { - "children": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"encapsed {$var}\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "encapsed ", - "unicode": false, - "value": "encapsed ", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": "var", - }, - ], - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings fix #101 case 2 1`] = ` -Program { - "children": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"encapsed {$arr[0]}\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "encapsed ", - "unicode": false, - "value": "encapsed ", - }, - OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "0", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "arr", - }, - }, - ], - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings fix #101 case 3 1`] = ` -Program { - "children": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"encapsed \${var}\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "encapsed ", - "unicode": false, - "value": "encapsed ", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": ConstRef { - "kind": "constref", - "name": "var", - }, - }, - ], - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings fix #123 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "string", - }, - "operator": "=", - "right": String { - "isDoubleQuote": false, - "kind": "string", - "raw": "'Avoid converting - chars, but \\\\' or \\\\\\\\ is ok.'", - "unicode": false, - "value": "Avoid converting - chars, but ' or \\\\ is ok.", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings fix #124 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "string", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"He drank some $juices[koolaid1] juice.\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "He drank some ", - "unicode": false, - "value": "He drank some ", - }, - OffsetLookup { - "kind": "offsetlookup", - "offset": ConstRef { - "kind": "constref", - "name": "koolaid1", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "juices", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " juice.", - "unicode": false, - "value": " juice.", - }, - ], - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings fix #144 1`] = ` -Program { - "children": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"encapsed \\\\\\" {$var}\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "encapsed \\\\\\" ", - "unicode": false, - "value": "encapsed \\" ", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": "var", - }, - ], - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings fix #149 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "b\\"foo\\\\nbar\\"", - "unicode": true, - "value": "foo -bar", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings implement #116 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"foo\\\\nbar\\"", - "unicode": false, - "value": "foo -bar", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings test backquotes 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`ls $cwd\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "ls ", - "unicode": false, - "value": "ls ", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "cwd", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`ls \${$cwd}\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "ls ", - "unicode": false, - "value": "ls ", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "cwd", - }, - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`ls {$cwd}\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "ls ", - "unicode": false, - "value": "ls ", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": "cwd", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`$var\`", - "type": "shell", - "value": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`\${var}\`", - "type": "shell", - "value": Array [ - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": ConstRef { - "kind": "constref", - "name": "var", - }, - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`{$var}\`", - "type": "shell", - "value": Array [ - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": "var", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`\`", - "type": "shell", - "value": Array [], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`\\\\\`\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "\\\\\`", - "unicode": false, - "value": "\\\\\`", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`{\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "{", - "unicode": false, - "value": "{", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`-{\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "-{", - "unicode": false, - "value": "-{", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`-$\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "-$", - "unicode": false, - "value": "-$", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\`$\`", - "type": "shell", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "$", - "unicode": false, - "value": "$", - }, - ], - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings test binary with double quotes 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "b\\"\\\\colors contains >$colors<\\\\n\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "\\\\colors contains >", - "unicode": false, - "value": "\\\\colors contains >", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "colors", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "<\\\\n", - "unicode": false, - "value": "< -", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings test double quotes 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"$\\"", - "unicode": false, - "value": "$", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"{\\"", - "unicode": false, - "value": "{", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"-$-\\"", - "unicode": false, - "value": "-$-", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"-{\\"", - "unicode": false, - "value": "-{", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"$b\\"", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"{$b}\\"", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": "b", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"\${$b}\\"", - "type": "string", - "value": Array [ - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"-$b?\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "-", - "unicode": false, - "value": "-", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "?", - "unicode": false, - "value": "?", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"-{$b}\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "-", - "unicode": false, - "value": "-", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": "b", - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"-\${$b}\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "-", - "unicode": false, - "value": "-", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"\\"", - "unicode": false, - "value": "", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"\\\\\\"\\"", - "unicode": false, - "value": "\\"", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings test empty nowdoc & heredoc contents 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "label": "HDOC", - "raw": " - HDOC - ; - echo <<<'NDOC' - NDOC - ; - ", - "type": "heredoc", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " HDOC - ; - echo <<<'NDOC' - NDOC - ; - ", - "unicode": false, - "value": " HDOC - ; - echo <<<'NDOC' - NDOC - ; - ", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [ - Error { - "expected": 220, - "kind": "error", - "line": 8, - "message": "Parse Error : syntax error, expecting T_END_HEREDOC on line 8", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings test encapsed elements 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "code", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "label": "EOFX", - "raw": " -{$this->docStar} -\${$foo} -\${targetDirs[1]} -$test[1] -$test->foo -EOFX", - "type": "heredoc", - "value": Array [ - PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "docStar", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "this", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -", - "unicode": false, - "value": " -", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -", - "unicode": false, - "value": " -", - }, - Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "1", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "targetDirs", - }, - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -", - "unicode": false, - "value": " -", - }, - OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "1", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "test", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -", - "unicode": false, - "value": " -", - }, - PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "test", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " -", - "unicode": false, - "value": " -", - }, - ], - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings test encapsed variable 1`] = ` -Program { - "children": Array [ - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"Hello $obj->name !\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "Hello ", - "unicode": false, - "value": "Hello ", - }, - PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "name", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "obj", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": " !", - "unicode": false, - "value": " !", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"Hello $obj->foo->bar !\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "Hello ", - "unicode": false, - "value": "Hello ", - }, - PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "obj", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "->bar !", - "unicode": false, - "value": "->bar !", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - Echo { - "arguments": Array [ - Encapsed { - "kind": "encapsed", - "raw": "\\"Hello $obj[1]->foo !\\"", - "type": "string", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "Hello ", - "unicode": false, - "value": "Hello ", - }, - OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "1", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "obj", - }, - }, - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "->foo !", - "unicode": false, - "value": "->foo !", - }, - ], - }, - ], - "kind": "echo", - "shortForm": false, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test strings test heredoc end of doc 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "label": "EOF2", - "raw": " -SOMETHING", - "type": "heredoc", - "value": Array [ - String { - "isDoubleQuote": false, - "kind": "string", - "raw": "SOMETHING", - "unicode": false, - "value": "SOMETHING", - }, - ], - }, - }, - ], - "errors": Array [ - Error { - "expected": 220, - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, expecting T_END_HEREDOC on line 2", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings test nowdoc end of doc 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Nowdoc { - "kind": "nowdoc", - "label": "EOF2", - "quote": true, - "raw": "<<<'EOF2' -FOO", - "value": "FOO", - }, - }, - ], - "errors": Array [ - Error { - "expected": 220, - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, expecting T_END_HEREDOC on line 2", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; - -exports[`Test strings test nowdoc label and contents 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "code", - }, - "operator": ".=", - "right": Nowdoc { - "kind": "nowdoc", - "label": "EOF", - "quote": true, - "raw": "<<<'EOF' - } -EOF;", - "value": " }", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/switch.test.js.snap b/test/snapshot/__snapshots__/switch.test.js.snap deleted file mode 100644 index 340e5b4d4..000000000 --- a/test/snapshot/__snapshots__/switch.test.js.snap +++ /dev/null @@ -1,356 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test SWITCH statements parse correctly 1`] = ` -Program { - "children": Array [ - Switch { - "body": Block { - "children": Array [ - Case { - "body": null, - "kind": "case", - "test": Number { - "kind": "number", - "value": "1", - }, - }, - Case { - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - "operator": "=", - "right": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - }, - Break { - "kind": "break", - "level": Number { - "kind": "number", - "value": "10", - }, - }, - ], - "kind": "block", - }, - "kind": "case", - "test": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "var", - }, - }, - Case { - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - "operator": "=", - "right": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - Break { - "kind": "break", - "level": null, - }, - ], - "kind": "block", - }, - "kind": "case", - "test": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "FOO", - "resolution": "uqn", - }, - }, - }, - Case { - "body": Block { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "bar", - }, - "operator": "=", - "right": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - }, - ], - "kind": "block", - }, - "kind": "case", - "test": null, - }, - ], - "kind": "block", - }, - "kind": "switch", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - Switch { - "body": Block { - "children": Array [ - Case { - "body": Block { - "children": Array [ - Return { - "expr": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - "kind": "return", - }, - ], - "kind": "block", - }, - "kind": "case", - "test": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "A", - "resolution": "uqn", - }, - }, - }, - Case { - "body": Block { - "children": Array [ - Return { - "expr": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - "kind": "return", - }, - ], - "kind": "block", - }, - "kind": "case", - "test": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - }, - }, - ], - "kind": "block", - }, - "kind": "switch", - "shortForm": true, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test SWITCH statements test errors 1`] = ` -Program { - "children": Array [ - Switch { - "body": Block { - "children": Array [ - Case { - "body": Block { - "children": Array [ - Switch { - "body": Block { - "children": Array [ - Case { - "body": Block { - "children": Array [ - Inline { - "kind": "inline", - "raw": " bug ", - "value": " bug ", - }, - ], - "kind": "block", - }, - "kind": "case", - "test": null, - }, - Case { - "body": Block { - "children": Array [ - Return { - "expr": null, - "kind": "return", - }, - Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - ], - "kind": "block", - }, - "kind": "case", - "test": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "A", - "resolution": "uqn", - }, - }, - }, - Case { - "body": Block { - "children": Array [ - Return { - "expr": Boolean { - "kind": "boolean", - "raw": "false", - "value": false, - }, - "kind": "return", - }, - ], - "kind": "block", - }, - "kind": "case", - "test": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "B", - "resolution": "uqn", - }, - }, - }, - ], - "kind": "block", - }, - "kind": "switch", - "shortForm": true, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "kind": "block", - }, - "kind": "case", - "test": null, - }, - ], - "kind": "block", - }, - "kind": "switch", - "shortForm": false, - "test": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "errors": Array [ - Error { - "expected": Array [ - "{", - ":", - ], - "kind": "error", - "line": 2, - "message": "Parse Error : syntax error, unexpected ';' on line 2", - "token": "';'", - }, - Error { - "expected": Array [ - 204, - 205, - ], - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected 'switch' (T_SWITCH) on line 3", - "token": "'switch' (T_SWITCH)", - }, - Error { - "expected": Array [ - ":", - ";", - ], - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected 'switch' (T_SWITCH) on line 3", - "token": "'switch' (T_SWITCH)", - }, - Error { - "expected": Array [ - 204, - 205, - ], - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected ' bug ' (T_INLINE_HTML) on line 3", - "token": "' bug ' (T_INLINE_HTML)", - }, - Error { - "expected": Array [ - ":", - ";", - ], - "kind": "error", - "line": 3, - "message": "Parse Error : syntax error, unexpected ' bug ' (T_INLINE_HTML) on line 3", - "token": "' bug ' (T_INLINE_HTML)", - }, - Error { - "expected": null, - "kind": "error", - "line": 7, - "message": "Parse Error : syntax error on line 7", - "token": "the end of file (EOF)", - }, - ], - "kind": "program", -} -`; diff --git a/test/snapshot/__snapshots__/token.test.js.snap b/test/snapshot/__snapshots__/token.test.js.snap deleted file mode 100644 index eede57b30..000000000 --- a/test/snapshot/__snapshots__/token.test.js.snap +++ /dev/null @@ -1,78 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test tokens statements hello world 1`] = ` -Program { - "children": Array [ - Inline { - "kind": "inline", - "raw": "Hello ", - "value": "Hello ", - }, - Echo { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "world", - }, - ], - "kind": "echo", - "shortForm": true, - }, - ], - "errors": Array [], - "kind": "program", - "tokens": Array [ - Array [ - "T_INLINE_HTML", - "Hello ", - 1, - 0, - 6, - ], - Array [ - "T_OPEN_TAG_WITH_ECHO", - "", - 1, - 18, - 20, - ], - ], -} -`; diff --git a/test/snapshot/__snapshots__/variable.test.js.snap b/test/snapshot/__snapshots__/variable.test.js.snap deleted file mode 100644 index 951b4bb13..000000000 --- a/test/snapshot/__snapshots__/variable.test.js.snap +++ /dev/null @@ -1,778 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test variables Chained encapsed vars 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"{$a->foo()[$bar[$foo]]}\\"", - "type": "string", - "value": Array [ - OffsetLookup { - "kind": "offsetlookup", - "offset": OffsetLookup { - "kind": "offsetlookup", - "offset": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "bar", - }, - }, - "what": Call { - "arguments": Array [], - "kind": "call", - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - }, - }, - ], - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test variables Check errors should be ? 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "?", - }, - "operator": "=", - "right": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "errors": Array [ - Error { - "expected": Array [ - "{", - "$", - 222, - ], - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '?' on line 1", - "token": "'?'", - }, - ], - "kind": "program", -} -`; - -exports[`Test variables Check errors should fail $foo->bar::! 1`] = ` -Program { - "children": Array [ - StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "!", - }, - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "bar", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - }, - }, - ], - "errors": Array [ - Error { - "expected": 105, - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '!', expecting T_STRING on line 1", - "token": "'!'", - }, - ], - "kind": "program", -} -`; - -exports[`Test variables Check errors should fail foo::bar::baz 1`] = ` -Program { - "children": Array [ - StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "baz", - }, - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "bar", - }, - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - }, - ], - "errors": Array [ - Error { - "expected": undefined, - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '::' (T_DOUBLE_COLON) on line 1", - "token": "'::' (T_DOUBLE_COLON)", - }, - ], - "kind": "program", -} -`; - -exports[`Test variables Check errors should fail on double static lookup 1`] = ` -Program { - "children": Array [ - StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "baz", - }, - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "bar", - }, - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": ConstRef { - "kind": "constref", - "name": Identifier { - "kind": "identifier", - "name": "this", - "resolution": "uqn", - }, - }, - }, - }, - }, - ], - "errors": Array [ - Error { - "expected": undefined, - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '::' (T_DOUBLE_COLON) on line 1", - "token": "'::' (T_DOUBLE_COLON)", - }, - ], - "kind": "program", -} -`; - -exports[`Test variables Check errors should fail on property lookup on static lookup 1`] = ` -Program { - "children": Array [ - PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "baz", - }, - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "bar", - }, - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "this", - }, - }, - }, - }, - ], - "errors": Array [ - Error { - "expected": undefined, - "kind": "error", - "line": 1, - "message": "Parse Error : syntax error, unexpected '->' (T_OBJECT_OPERATOR) on line 1", - "token": "'->' (T_OBJECT_OPERATOR)", - }, - ], - "kind": "program", -} -`; - -exports[`Test variables Class constants 1`] = ` -Program { - "children": Array [ - Call { - "arguments": Array [], - "kind": "call", - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": ConstRef { - "kind": "constref", - "name": "static", - }, - }, - }, - Call { - "arguments": Array [], - "kind": "call", - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": Identifier { - "kind": "identifier", - "name": "self", - "resolution": "uqn", - }, - }, - }, - Call { - "arguments": Array [], - "kind": "call", - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": Identifier { - "kind": "identifier", - "name": "parent", - "resolution": "uqn", - }, - }, - }, - StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "class", - }, - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - Call { - "arguments": Array [], - "kind": "call", - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "this", - }, - }, - }, - StaticLookup { - "kind": "staticlookup", - "offset": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "bar", - }, - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - Call { - "arguments": Array [], - "kind": "call", - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "qux", - }, - "what": OffsetLookup { - "kind": "offsetlookup", - "offset": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"baz\\"", - "unicode": false, - "value": "baz", - }, - "what": StaticLookup { - "kind": "staticlookup", - "offset": ConstRef { - "kind": "constref", - "name": "bar", - }, - "what": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "foo", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "this", - }, - }, - }, - }, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test variables Dynamic variables 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"bar\\"", - "unicode": false, - "value": "bar", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"bar\\"", - "unicode": false, - "value": "bar", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": true, - "kind": "variable", - "name": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"bar\\"", - "unicode": false, - "value": "bar", - }, - "type": ".", - }, - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"bar\\"", - "unicode": false, - "value": "bar", - }, - }, - Assign { - "kind": "assign", - "left": OffsetLookup { - "kind": "offsetlookup", - "offset": Bin { - "kind": "bin", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"bar\\"", - "unicode": false, - "value": "bar", - }, - "type": ".", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "foo", - }, - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"bar\\"", - "unicode": false, - "value": "bar", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test variables Encaps var offset 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"{$a[1]}\\"", - "type": "string", - "value": Array [ - OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "1", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"{$a[\\"a\\"]}\\"", - "type": "string", - "value": Array [ - OffsetLookup { - "kind": "offsetlookup", - "offset": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"a\\"", - "unicode": false, - "value": "a", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - ], - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": Encapsed { - "kind": "encapsed", - "raw": "\\"{$a[$b]}\\"", - "type": "string", - "value": Array [ - OffsetLookup { - "kind": "offsetlookup", - "offset": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - ], - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test variables Variable chains 1`] = ` -Program { - "children": Array [ - StaticLookup { - "kind": "staticlookup", - "offset": OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "2", - }, - "what": OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "1", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - }, - "what": Identifier { - "kind": "identifier", - "name": "foo", - "resolution": "uqn", - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test variables array destructuring 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": List { - "arguments": Array [ - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "id1", - }, - Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "name1", - }, - ], - "kind": "list", - "shortForm": true, - }, - "operator": "=", - "right": OffsetLookup { - "kind": "offsetlookup", - "offset": Number { - "kind": "number", - "value": "0", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "data", - }, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; - -exports[`Test variables default variables 1`] = ` -Program { - "children": Array [ - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - "operator": "=", - "right": String { - "isDoubleQuote": true, - "kind": "string", - "raw": "\\"foo\\"", - "unicode": false, - "value": "foo", - }, - }, - Assign { - "kind": "assign", - "left": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "b", - }, - "operator": "=", - "right": Variable { - "byref": true, - "curly": false, - "kind": "variable", - "name": "c", - }, - }, - Assign { - "kind": "assign", - "left": PropertyLookup { - "kind": "propertylookup", - "offset": ConstRef { - "kind": "constref", - "name": "b", - }, - "what": Variable { - "byref": false, - "curly": false, - "kind": "variable", - "name": "a", - }, - }, - "operator": "=", - "right": Boolean { - "kind": "boolean", - "raw": "true", - "value": true, - }, - }, - ], - "errors": Array [], - "kind": "program", -} -`; diff --git a/test/snapshot/acid.test.js b/test/snapshot/acid.test.js deleted file mode 100644 index ec435a896..000000000 --- a/test/snapshot/acid.test.js +++ /dev/null @@ -1,172 +0,0 @@ -const parser = require('../main'); - -describe('Acid', () => { - it('level 1', () => { - expect(parser.parseCode(`#!/usr/bin/php - -Hello 'achoum', - 'bashful' => 'tadah' - ]; - /** - * Something is done here - */ - final public function doSomething() { - // do not wanna do - foreach($this->dwarf as $name => $greeting) { - echo "Hey ho $name, $greeting !"; - continue $foo; - } - throw new \\ComeToHome('Thats it'); - } - } - - interface Miror extends Object { - public function Am_I_Uggly() : bool; - protected function broken() : bool; - static protected function isWhiteSnowAlive() : bool; - } - - function iter() { - yield 'ator' => $foo; - yield from iter(50); - } - - trait Line { - public function draw(bool $arrow = false) : string { - switch($this->style) { - case 'dot': - case 'point': - $body = '......'; - break; - default: - $body = '-----'; - break; - } - return $body . ($arrow ? '>' : ''); - } - private function shuut() { - return __NAMESPACE__; - } - } - - // this is SPARTA ! - function sparta() : ?int { - global $persians; - - $index = -1; -next: - $guy = $persians[++$index]; - if(rand(0, 10)>5 || false) { - @$guy->kill(); - } else { - $guy->kick(...$foo); - } - if ((int)$index < count($persians)) goto next; - - return 300 | 5; - } - - $foo = function(?int $bar = 42) use($something) : bool { - static $banana; - if($bar > fooBar::NUMBAR) { - while($bar) { - if ((int)calculateMeaningOfLife() === 42) { - break foo; - } else continue; - } - do { - ?> - Caesar: here I was - crazy()->boom([1, 2, 3]); - } catch(Coco|Nut $ex) { - $ex->printStackTrace(); - } finally { - if (isset($bipbip, $ex)) unset($bipbip, $ex); - return (new class extends fooBar { - function goatIt() { - return "meeeh"; - } - })->goatIt(); - } - } else { - for($i = 0; $i < count($this->banana); $i++) { - $x %= ($i * 2) / ($i - 1); - $what = $this->$x[++$i] ? 'yes!': 'noo!'; - } - // @todo $this->a_$foo - return $$foo ?? false; - } - return empty(namespace\\FOOBAR); - }; - - if ($foo): - echo \`bar&\`; - elseif ($bar): - echo \`ls -larth\`; - endif; - - // list version - list(,$a, list($b, $c)) = [1, [2, 3]]; - [,$a,[$b, ,$c]] = $f; - print(<< { - it('deference array', () => { - expect( - parser.parseEval( - ['$a = [', '"a", "b"', ']($foo)[$foo->bar()[1]]->foo()'].join('\r'), - ), - ).toMatchSnapshot(); - }); - - it('of strings', () => { - expect( - parser.parseEval('array("item1", "item2", "item3")'), - ).toMatchSnapshot(); - }); - - it('of numbers', () => { - expect(parser.parseEval('array(1, 2.5, 0x1000)')).toMatchSnapshot(); - }); - - it('of strings and numbers', () => { - expect(parser.parseEval('array(1, "item2", 3, "item4")')).toMatchSnapshot(); - }); - - it('of variables', () => { - expect(parser.parseEval('array($obj1, $obj2, $obj3)')).toMatchSnapshot(); - }); - - it('of objects', () => { - expect( - parser.parseEval('[new foo(), new stdClass(), new bar()]'), - ).toMatchSnapshot(); - }); - - it('of arrays', () => { - expect( - parser.parseEval(` - array( - array("item1", "item2"), - array("item3", "item4"), - array("item5", "item6") - )`), - ).toMatchSnapshot(); - }); - - describe('mixed tests / coverage', function() { - it('test empty array', function() { - expect(parser.parseEval('$a = []; $b = array();')).toMatchSnapshot(); - }); - it('test short form / keys', function() { - expect( - parser.parseEval('[0 => &$foo, $bar => "foobar"];'), - ).toMatchSnapshot(); - }); - }); -}); diff --git a/test/snapshot/ast.test.js b/test/snapshot/ast.test.js deleted file mode 100644 index 3e4a83369..000000000 --- a/test/snapshot/ast.test.js +++ /dev/null @@ -1,99 +0,0 @@ -const parser = require('../main'); - -describe("Test AST structure", function() { - it('fix #127 - echo statements', () => { - expect(parser.parseEval('echo "hello"; ?> world')).toMatchSnapshot(); - }); - - it('fix #127 - inline', function() { - expect(parser.parseEval('?>?>?>')).toMatchSnapshot(); - }); - - it('test program', function() { - expect(parser.parseEval('')).toMatchSnapshot(); - }); - it("test syntax error", function() { - const parse = function() { - parser.parseEval(` - $a = 1 - $b = 2 - `); - }; - expect(parse).toThrowErrorMatchingSnapshot(); - }); - it("test inline", function() { - expect( - parser.parseCode("Hello \n !") - ).toMatchSnapshot(); - }); - - it("fix #120", function() { - expect( - parser.parseCode("\r\n !") - ).toMatchSnapshot(); - }); - - it("test magics", function() { - expect( - parser.parseEval("echo __FILE__, __DIR__;") - ).toMatchSnapshot(); - }); - it("test shell", function() { - expect( - parser.parseEval("echo `ls -larth`;") - ).toMatchSnapshot(); - }); - it("test clone", function() { - expect( - parser.parseEval("$a = clone $var;") - ).toMatchSnapshot(); - }); - it("test echo, isset, unset, empty", function() { - expect( - parser.parseEval(` - echo ($expr) ? "ok" : "ko"; - print "some text"; - isset($foo, $bar); - unset($var); - empty($var); - `) - ).toMatchSnapshot(); - }); - - it("test constants", function() { - expect( - parser.parseEval("const FOO = 3.14;") - ).toMatchSnapshot(); - }); - - it("test eval", function() { - expect( - parser.parseEval('eval("return true;");') - ).toMatchSnapshot(); - }); - it("test die/exit", function() { - expect( - parser.parseEval(` - die("bye"); - exit(-1); - `) - ).toMatchSnapshot(); - }); - - it("test coalesce operator", function() { - expect( - parser.parseEval("$var = $a ?? true;") - ).toMatchSnapshot(); - }); - - it("test include / require", function() { - expect( - parser.parseEval(` - include "file.php"; - include_once (PATH . "/file.php"); - require "req.php"; - require_once "file.php"; - `) - ).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/buffer.test.js b/test/snapshot/buffer.test.js deleted file mode 100644 index 3c26bcefc..000000000 --- a/test/snapshot/buffer.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const parser = require('../main'); - -describe("Test buffers", function() { - it("handles buffers as input", function() { - var buffer = new Buffer('echo "test"'); - expect(parser.parseEval(buffer)).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/class.test.js b/test/snapshot/class.test.js deleted file mode 100644 index ee6fe13cf..000000000 --- a/test/snapshot/class.test.js +++ /dev/null @@ -1,94 +0,0 @@ -const parser = require('../main'); - -describe("Test classes", function() { - it("Validate usual declarations", function() { - expect(parser.parseEval(` - final class foo extends bar implements - bim, bam, boum { - const FOO = "azerty"; - public static $var; - public function __construct(array $data = null) { - $this->data = $data; - } - const list = "bar"; - public function new($foo = self::list) { - return $this::list; - } - protected $foo; - private $bar; - function foobar() {} - } - abstract class bar { - use A, B { - B::smallTalk insteadof A; - A::bigTalk insteadof B, C; - B::bigTalk as public talk; - B::bigTalk as protected talk; - B::bigTalk as private talk; - A::new as list; - list as new; - } - /** - * Some informations - */ - abstract protected function &foo() : bar; - }` - )).toMatchSnapshot(); - }); - - it("Advanced tests", function() { - expect(parser.parseEval(` - class foo implements boo { - use A; - use B { foo as bar; } - // comment - /* boo */ - /** doc - * data - foo - */ - var $var = true; - final function __construct() { } - private function boo() { } - } - interface boo extends something { - // some doc - const A = 1.5; - /** foo */ - protected function foo(); - } - trait line extends foo implements boo { - // some doc - const A = 1.5; - abstract protected function foo(); - } - `, { - parser: { extractDoc: true } - })).toMatchSnapshot(); - }); - - it("Test of silent mode", function() { - expect(parser.parseEval(` - class foo { - use A - use B { foo }; - }`, - { - parser: { suppressErrors: true } - } - )).toMatchSnapshot(); - }); - - it("Test js properties", function() { - expect(parser.parseEval(` - class __proto__ { - static $constructor; - public function constructor() {} - public function __proto__() { - $this->constructor = null; - self::$constructor = null; - } - }` - )).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/comment.test.js b/test/snapshot/comment.test.js deleted file mode 100644 index e8baaf835..000000000 --- a/test/snapshot/comment.test.js +++ /dev/null @@ -1,151 +0,0 @@ -const parser = require('../main'); - -describe("Test comments", function() { - describe("issues", function() { - it("fix #126 : new option", function() { - const ast = parser.parseEval( - ` - if (true) { - $a = 1; - } - // Don't parsed :( - else if (false) { - $a = 2; - } - `, - { - parser: { - extractDoc: true - } - } - ); - expect(ast).toMatchSnapshot(); - }); - it("fix #55", function() { - const ast = parser.parseEval( - ` - if (true): - if (true): - // inner statements - endif; // another comment - endif; // 2nd comment - `, - { - parser: { - extractDoc: true - // debug: true - } - } - ); - expect(ast).toMatchSnapshot(); - }); - }); - - it("test single line comments", function() { - const ast = parser.parseEval( - ` - # some information - // another line - $foo = 123 // 123 - ; /* done */ - `, - { - parser: { - extractDoc: true - } - } - ); - expect(ast).toMatchSnapshot(); - }); - - describe("multi line comments", function() { - it("test function", function() { - const ast = parser.parseEval( - ` - /** - * Description - */ - function /* ignore */ & /* ignore */ name(/* @var something */ $arg) { - // inner - return $arg /* ignore */; - } - `, - { - parser: { - extractDoc: true - } - } - ); - expect(ast).toMatchSnapshot(); - }); - it("test if statements", function() { - const ast = parser.parseEval( - ` - if /* ignore */ (/* */ true) /* ignore */ { - # inner statement - } /* ignore */ else /* ignore */ - // else with a inner if single statement : - if (true /* ignore */) /* ignore */ { - } /* ignore */ elseif /* ignore */ (/* ignore */ false /* ignore */ /* ignore */) /* ignore */ /* ignore */ { - } /* ignore */ else /* ignore */ { - } - if (false) /* ignore */ : /* ignore */ - /* ignore */ endif /* ignore */;/* ignore */ - `, - { - parser: { - extractDoc: true - } - } - ); - expect(ast).toMatchSnapshot(); - }); - it("test try statements", function() { - const ast = parser.parseEval( - ` - try /* ignore */ { - # inner statement - } /* dd */ catch(/* zz */ \\Exception /* 1 */ | /* 2 */ \\Foo /* aa */ $e /* bb */) /* dd */ { - /* ee */ - } /* zz */ finally /* yy */ { - /* ignore */ - } // end - `, - { - parser: { - extractDoc: true - } - } - ); - expect(ast).toMatchSnapshot(); - }); - }); - - it("test classes", function() { - const ast = parser.parseEval( - ` - /** - * Description - */ - class /* ignore */ name /* hehe */ { - // @var test - protected $test, $toto; - // ignored comment - /** @var Class */ - static public $foo = 123; - /** ignored also **/ - /** - * @return void - */ - public function void() { } - } - `, - { - parser: { - extractDoc: true - } - } - ); - expect(ast).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/expr.test.js b/test/snapshot/expr.test.js deleted file mode 100644 index f929087e7..000000000 --- a/test/snapshot/expr.test.js +++ /dev/null @@ -1,238 +0,0 @@ -const parser = require('../main'); - -describe("Test expressions", function() { - it("test binary", function() { - const ast = parser.parseEval( - ` - 1 | 3; - 1 & 3; - 1 ^ 3; - "1" . "3"; - 1 + 3; - 1 - 3; - 1 * 3; - 1 / 3; - 1 % 3; - 1 ** 3; - 1 << 3; - 1 >> 3; - ` - ); - expect(ast).toMatchSnapshot(); - }); - - it("test more binary ops (formerly bool)", function() { - const ast = parser.parseEval( - ` - $a && $b; - $a AND $b; - $a || $b; - $a OR $b; - $a XOR $b; - $a === $b; - $a !== $b; - $a == $b; - $a != $b; - $a > $b; - $a < $b; - $a >= $b; - $a <= $b; - $a <=> $b; - $a instanceof $b; - ` - ); - expect(ast).toMatchSnapshot(); - }); - - it("test assignements", function() { - const ast = parser.parseEval( - ` - $a = $b; - $a .= $b; - $a += $b; - $a -= $b; - $a *= $b; - $a **= $b; - $a /= $b; - $a &= $b; - $a |= $b; - $a %= $b; - $a ^= $b; - $a <<= $b; - $a >>= $b; - ` - ); - expect(ast).toMatchSnapshot(); - }); - - it("test if based returns", function() { - const ast = parser.parseEval( - ` - $a ?? false; - $a > 5 ? true : false; - $a ?: false; - ` - ); - expect(ast).toMatchSnapshot(); - }); - - it("test silent", function() { - const ast = parser.parseEval("@trigger_error();"); - expect(ast).toMatchSnapshot(); - }); - - it("test generators", function() { - const ast = parser.parseEval( - ` - function gen() { - yield 0; // key 0 - yield from foo(); // keys 0-2 - yield 1 => $a; // key 1 - } - ` - ); - expect(ast).toMatchSnapshot(); - }); - - it("test unary", function() { - const ast = parser.parseEval( - ` - +$var; - ~$var; - !$var; - -$var; - ` - ); - expect(ast).toMatchSnapshot(); - }); - - it("test cast", function() { - const ast = parser.parseEval( - ` - (int)$var; - (integer)$var; - (bool)$var; - (boolean)$var; - (float)$var; - (double)$var; - (real)$var; - (string)$var; - (binary)$var; - (array)$var; - (object)$var; - (unset)$var; - ` - ); - expect(ast).toMatchSnapshot(); - }); - - - it("test cast extension - #171", function() { - const ast = parser.parseEval( - ` - (int)$var; - (integer)$var; - (bool)$var; - (boolean)$var; - (float)$var; - (double)$var; - (real)$var; - (string)$var; - (binary)$var; - (array)$var; - (object)$var; - (unset)$var; - `, { - parser: { - read_expr_cast: function(cast) { - const rawCast = this.text(); - const expr = this.next().read_expr(); - expr.cast = cast; - expr.rawCast = rawCast; - return expr; - } - } - } - ); - expect(ast).toMatchSnapshot(); - }); - - it("test exit", function() { - const ast = parser.parseEval( - ` - exit(1); - die(); - exit; - ` - ); - expect(ast).toMatchSnapshot(); - }); - - it("test incr/decr", function() { - const ast = parser.parseEval( - ` - $i++; - $i--; - ++$i; - --$i; - `, - { - ast: { - withPositions: true - } - } - ); - expect(ast).toMatchSnapshot(); - }); - - it("should fail to assign constants", function() { - const ast = parser.parseEval("a = 1;", { - parser: { debug: false, suppressErrors: true } - }); - expect(ast).toMatchSnapshot(); - }); - - it("should fail to assign class constants", function() { - const ast = parser.parseEval("foo::b = 1;", { - parser: { debug: false, suppressErrors: true } - }); - expect(ast).toMatchSnapshot(); - }); - - it("should assign class static", function() { - const ast = parser.parseEval("a::$b = 1;", { - parser: { debug: false, suppressErrors: true } - }); - expect(ast).toMatchSnapshot(); - }); - - it("test new", function() { - const ast = parser.parseEval( - ` - $a = new \\foo(); - $a = new namespace\\foo::class(); - $a = new $foo(); - $a = new class extends foo implements bar { }; - `, - { - parser: { debug: false } - } - ); - expect(ast).toMatchSnapshot(); - }); - - it("test nested expressions precedence", function() { - const ast = parser.parseEval( - ` - $a = 5 * 2 + 1; // same as ((5 * 2) + 1) - $b = 5 * (2 + 1); - $c = 1 + 2 / 3 + 4; // same as (1 + ((2 / 3) + 4)) - $d = 1 !== 2 && 3; // same as (1 !== 2) && 3 - `, - { - parser: { debug: false } - } - ); - expect(ast).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/function.test.js b/test/snapshot/function.test.js deleted file mode 100644 index ce073e999..000000000 --- a/test/snapshot/function.test.js +++ /dev/null @@ -1,39 +0,0 @@ -const parser = require('../main'); - -describe("Function tests", function() { - it("test function parsing", function() { - const ast = parser.parseEval( - ` - function &foo($a = 1, callable $b, ?array &...$params) : ?boolean {} - $a = function &($b) use(&$c, $d) : array { - return true; - }; - $b = foo(...[1, null, 1, 2, 3]); - ` - ); - expect(ast).toMatchSnapshot(); - }); - - it("test variadic error", function() { - const astErr = parser.parseEval(`$b = foo(...[1, 2, 3], $a);`, { - parser: { - suppressErrors: true - } - }); - expect(astErr).toMatchSnapshot(); - }); - - it("test reserved word for function name error", function() { - const astErr = parser.parseEval(`function list() {}`, { - parser: { - suppressErrors: true - } - }); - expect(astErr).toMatchSnapshot(); - }); - - it("test static closure", function() { - const ast = parser.parseEval("$a = static function() {};"); - expect(ast).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/graceful.test.js b/test/snapshot/graceful.test.js deleted file mode 100644 index 0d42e7c38..000000000 --- a/test/snapshot/graceful.test.js +++ /dev/null @@ -1,50 +0,0 @@ -const parser = require('../main'); - -describe("Test graceful mode", function() { - describe("to suppress errors", function() { - var test = parser.create({ - parser: { - suppressErrors: true - } - }); - - it("should contain 2 errors", function() { - expect(test.parseEval([ - "$var = ", // 1. - "function() {", // 2. - "$foo = ", // 3. <-- missing expr - "}", // 4. - "}" // 5. <-- extra '}' token here - ].join("\n"))).toMatchSnapshot(); - }); - - it("test expr", function() { - expect(test.parseEval("$a = $b -; $foo = $a;")).toMatchSnapshot(); - }); - - it("test class", function() { - expect(test.parseEval("class foo { foo const A = 1 ")).toMatchSnapshot(); - }); - - it("test flags", function() { - expect(test.parseEval(` - final final interface foo { - abstract function func() - `)).toMatchSnapshot(); - }); - - it("test function arguments", function() { - expect(test.parseEval(` - $foo->bar($arg, ); - $foo = new bar($baz, ,$foo); - `)).toMatchSnapshot(); - }); - - it("test method chains", function() { - expect(test.parseEval(` - $controller->expects($this->once()) - -> - `)).toMatchSnapshot(); - }); - }); -}); diff --git a/test/snapshot/if.test.js b/test/snapshot/if.test.js deleted file mode 100644 index 719caab60..000000000 --- a/test/snapshot/if.test.js +++ /dev/null @@ -1,120 +0,0 @@ -const parser = require('../main'); - -describe("Test IF statements", function() { - it("test common cases", function() { - const ast = parser.parseEval( - ` - if (true) { - echo "is true"; - } else if (false) { - echo "false"; - } elseif (false) { - echo "2nd"; - } else { - echo "else"; - } - `, - { - parser: { debug: false } - } - ); - expect(ast).toMatchSnapshot(); - }); - - it("test short form", function() { - const ast = parser.parseEval( - ` - if (true): - echo "is true"; - elseif (false): - echo "false"; - else: - echo "else"; - endif; - `, - { - parser: { debug: false } - } - ); - expect(ast).toMatchSnapshot(); - }); - - it("test various cases", function() { - const ast = parser.parseEval( - ` - if (true): - echo "is true"; - elseif (false): - echo "false"; - elseif (false): - echo "false"; - endif; - if (true): - echo "is true"; - else: - echo "false"; - endif; - `, - { - parser: { debug: false } - } - ); - expect(ast).toMatchSnapshot(); - }); - - it("test issue #84", function() { - const ast = parser.parseCode( - ` - - - - `, - { - parser: { debug: false } - } - ); - expect(ast).toMatchSnapshot(); - }); - it("test issue #168", () => { - - // should be ok - let ast = parser.parseCode( - ` - `, - { - ast: { - withPositions: true, - withSource: true - } - } - ); - expect(ast).toMatchSnapshot(); - - // should ignore ?> - ast = parser.parseCode( - ` - `, - { - ast: { - withPositions: true, - withSource: true - } - } - ); - expect(ast).toMatchSnapshot(); - - // should include ';' - ast = parser.parseCode( - `", { - lexer: { - short_tags: true - } - })).toMatchSnapshot(); - }); - - it("parse short echo", function() { - expect(parser.parseCode("", { - lexer: { - short_tags: true - } - })).toMatchSnapshot(); - }); - - it("parse asp tag", function() { - expect(parser.parseCode("<% echo $b; %>", { - lexer: { - short_tags: true, - asp_tags: true - } - })).toMatchSnapshot(); - }); - - it("parse asp echo tag", function() { - expect(parser.parseCode("<%= $b %>", { - lexer: { - short_tags: true, - asp_tags: true - } - })).toMatchSnapshot(); - }); - }); - - it("test comments", function() { - expect(parser.parseCode(` - - <% - // another line %> - - list;')).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/list.test.js b/test/snapshot/list.test.js deleted file mode 100644 index c7ab7d3b8..000000000 --- a/test/snapshot/list.test.js +++ /dev/null @@ -1,34 +0,0 @@ -const parser = require('../main'); - -describe("Test list expressions", function() { - it("test list statements", function() { - const ast = parser.parseEval(`list($a => list($c,$d,,$e,), $b) = [1, 2];`, { - ast: { - withPositions: true - } - }); - expect(ast).toMatchSnapshot(); - }); - - it("test short list", function() { - expect(parser.parseEval(`[$a => [$c,$d,,$e,], $b] = [1 => [5, 6, 7, 8, 9,], 2];`, { - ast: { - withPositions: true - } - })).toMatchSnapshot(); - }); - - it("fix #150", function() { - const ast = parser.parseEval("list('foo' => $bar) = ['foo' => 'bar'];"); - expect(ast).toMatchSnapshot(); - }); - - it("fix #137", function() { - const ast = parser.parseEval("list(,,$a,,$b) = [null, 1, null, 2];", { - ast: { - withPositions: true - } - }); - expect(ast).toMatchSnapshot(); - }); -}); \ No newline at end of file diff --git a/test/snapshot/location.test.js b/test/snapshot/location.test.js deleted file mode 100644 index 6db3e4621..000000000 --- a/test/snapshot/location.test.js +++ /dev/null @@ -1,28 +0,0 @@ -const parser = require('../main'); - -describe('Test locations', function() { - it('#164 : expr must include ;', function() { - expect( - parser.parseEval( - '$a = $b + 1;', { - ast: { - withPositions: true, - withSource: true - } - } - ) - ).toMatchSnapshot(); - }); - it('#164 : expr should avoid ?>', function() { - expect( - parser.parseCode( - '', { - ast: { - withPositions: true, - withSource: true - } - } - ) - ).toMatchSnapshot(); - }); -}); \ No newline at end of file diff --git a/test/snapshot/loop.test.js b/test/snapshot/loop.test.js deleted file mode 100644 index 701c282bf..000000000 --- a/test/snapshot/loop.test.js +++ /dev/null @@ -1,76 +0,0 @@ -const parser = require('../main'); - -describe("Test loops statements (for, while)", function() { - describe("test while", function() { - it("test default form", function() { - expect(parser.parseEval(` - while(true) { - echo "go"; - } - `)).toMatchSnapshot(); - }); - - it("test short form", function() { - expect(parser.parseEval(` - while(true): - echo "short"; - endwhile; - `)).toMatchSnapshot(); - }); - }); - - it("test do", function() { - expect(parser.parseEval(` - do { - echo "something"; - } while(true); - `, { - parser: { debug: false } - })).toMatchSnapshot(); - }); - - it("test for", function() { - expect(parser.parseEval(` - for($i = 0, $b = 0; $i < 10, $ok; $i++) - echo $i; - for(;;): - echo $ok; - continue 5; - continue(5); - endfor; - `, { - parser: { debug: false } - })).toMatchSnapshot(); - }); - - it("test foreach", function() { - expect(parser.parseEval(` - foreach(&$foo as $v) - echo "$k -> $v\n"; - foreach( - [[1,2], [3,4]] as - $a => - [$c, $d] - ): - echo "$a -> $b\n"; - endforeach; - `, { - parser: { debug: false } - })).toMatchSnapshot(); - }); - it("fix #122", function() { - // https://github.com/glayzzle/php-parser/issues/122 - expect(parser.parseEval(` - foreach($foo as $bar => array($foo)) - echo "$k -> $v\n"; - `, { - parser: { suppressErrors: true } - })).toMatchSnapshot(); - expect(parser.parseEval(` - foreach($foo as [$bar] => $foo) - echo "$k -> $v\n"; - `, { - parser: { suppressErrors: true } - })).toMatchSnapshot(); - }) -}); diff --git a/test/snapshot/namespace.test.js b/test/snapshot/namespace.test.js deleted file mode 100644 index 320b99f75..000000000 --- a/test/snapshot/namespace.test.js +++ /dev/null @@ -1,140 +0,0 @@ -const parser = require('../main'); - -describe("Test namespace statements", function() { - - it("test single namespace", function() { - expect(parser.parseEval(` - namespace foo; - use bar\\baz as barBaz; - use const bar\\baz as barBaz, baz\\boo as bazBoo; - use function bar\\baz as barBaz, baz\\boo as bazBoo; - use bar\\baz { - const FOO as BAZ_FOO, - function BOO as BAZ_BOO - }; - use const azerty { - A as AZERTY_A, - B as AZERTY_B - }; - $a = namespace\\barBaz; - $b = \\barBaz; - $c = barBaz\\foo; - $d = barBaz; - `, { - parser: { - debug: false - } - })).toMatchSnapshot(); - }); - - it("test multiple namespace", function() { - expect(parser.parseEval(` - namespace \\foo { - $i++; - } - namespace { - $b++; - } - `, { - parser: { - debug: false - } - })).toMatchSnapshot(); - }); - - it("test namespace keyword", function() { - expect(parser.parseEval(` - namespace\\foo(); - $var = namespace\\bar; - `, { - parser: { - debug: false - } - })).toMatchSnapshot(); - }); - - it("test namespace error", function() { - expect(parser.parseEval(` - namespace $var = true; - `, { - parser: { - debug: false, - suppressErrors: true - } - })).toMatchSnapshot(); - }); - - it("check namespace", function() { - // @todo - }); - - it("check use", function() { - // @todo - }); - - it("check resolution", function() { - // @todo - }); - - it("check silent mode", function() { - expect(parser.parseEval(` - namespace $var = true; - `, { - parser: { - debug: false, - suppressErrors: true - } - })).toMatchSnapshot(); - }); - - it("work with declare statement", function() { - expect(parser.parseEval(` - declare(strict_types=1); - namespace foo; - class bar {} - `)).toMatchSnapshot(); - }); - - describe("read usegroup location correctly", function() { - const testString = ` - namespace Test\\test\\test; - - use Some\\other\\test; - - /** - * @property \\Test\\test $test - */ - class Foo extends Bar implements Baz, Buzz { - public $test; - - function test() { - return true; - } - - public function &passByReferenceTest() { - $a = 1; - return $a; - } - } - `; - - it("without docs", function() { - expect(parser.parseEval(testString, { - ast: { - withPositions: true - } - })).toMatchSnapshot() - }); - - it("with docs", function() { - expect(parser.parseEval(testString, { - ast: { - withPositions: true - }, - parser: { - extractDoc: true - } - })).toMatchSnapshot() - }); - }); -}); diff --git a/test/snapshot/number.test.js b/test/snapshot/number.test.js deleted file mode 100644 index 56601fe35..000000000 --- a/test/snapshot/number.test.js +++ /dev/null @@ -1,32 +0,0 @@ -const parser = require('../main'); - -describe("Test numbers", function() { - it("test common cases", function() { - expect(parser.parseEval(` - $a = -1.5; - $b = 1234; - $c = 9223372036854775807; - $c = 9223372036854775808; - $d = 0x1A; - $d = 0xFF; - $e = 0b1011; - $f = 0123; - $g = 1.2e3; - $h = 7E-10; - `)).toMatchSnapshot(); - }); - - it("test edge cases", function() { - expect(parser.parseEval(` - $a = 0xx; - $b = 0b2; - $c = 01239; - $d = 7E-a; - $e = 7EX; - `, { - parser: { - suppressErrors: true - } - })).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/php5.test.js b/test/snapshot/php5.test.js deleted file mode 100644 index 8c9fafb6b..000000000 --- a/test/snapshot/php5.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const parser = require('../main'); - -describe('Test syntax parsing without PHP7 support', function() { - - it('special keywords should fail', function() { - var ast = parser.parseEval('class foo { function list() { } }', { - parser: { - php7: false, - suppressErrors: true - } - }); - expect(ast).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/scalar.test.js b/test/snapshot/scalar.test.js deleted file mode 100644 index 0fc6830fb..000000000 --- a/test/snapshot/scalar.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const parser = require('../main'); - -describe("Test scalar statements", function() { - it("test constants", function() { - expect(parser.parseEval('$a = foo::ref[-5];')).toMatchSnapshot(); - }); - - it("test dereferencable", function() { - expect(parser.parseEval(` - $a = foo::bar()[5]->test; - $b = (new test())->foo(); - $c = (foo())[5]; - $d = (function($a) { return $a * 2; })(5); - `)).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/statement.test.js b/test/snapshot/statement.test.js deleted file mode 100644 index f63d50625..000000000 --- a/test/snapshot/statement.test.js +++ /dev/null @@ -1,111 +0,0 @@ -const parser = require('../main'); - -describe("Test statements", function() { - it("test goto label", function() { - expect(parser.parseEval(` - start: - $i++; - goto start; - `)).toMatchSnapshot(); - }); - - it("test global", function() { - expect(parser.parseEval(` - function foo() { - global $a, $b; - } - `)).toMatchSnapshot(); - }); - - describe('halt statements', function() { - it("test halt statement", function() { - expect(parser.parseEval(` - $a = 1; - __halt_compiler(); - $b = 1; - `, { - parser: { debug: false } - })).toMatchSnapshot(); - }); - - it("test inner error", function() { - expect(() => { - parser.parseEval(` - if (true) { - __halt_compiler(); - } - `) - }).toThrow(); - }); - - it("test fallback", function() { - expect(parser.parseEval(` - if (true) { - __halt_compiler(); - } - $b = 1; - `, { - parser: { suppressErrors: true } - })).toMatchSnapshot(); - }); - }); - - it("test static", function() { - expect(parser.parseEval(` - function foo() { - static $a, $b = 5; - } - static $sVar1 = 11; - `, { - parser: { debug: false } - })).toMatchSnapshot(); - }); - - it("test declare", function() { - expect(parser.parseEval(` - if (true) { declare(ticks=1); } - $a = 1; - declare(ticks=2,encoding=ISO-8859-1); - $b = 1; - declare(ticks=1) { - $c = 2; - } - declare(encoding="UTF-8"): - $d = 3; - enddeclare; - $e = 4; - `, { - parser: { debug: false } - })).toMatchSnapshot(); - }); - - it("test try", function() { - expect(parser.parseEval(` - try { - foo(); - } catch(FooError|BarError $err) { - var_dump($err); - throw $err; - } finally { - clean(); - } - `, { - parser: { debug: false } - })).toMatchSnapshot(); - }); - - it("test inner statements", function() { - expect(parser.parseEval(` - if (true) { - function foo() {} - abstract class foo {} - final class foo {} - class foo {} - trait foo {} - interface foo {} - } - `, { - parser: { debug: false } - })).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/string.test.js b/test/snapshot/string.test.js deleted file mode 100644 index 0f256b6f8..000000000 --- a/test/snapshot/string.test.js +++ /dev/null @@ -1,317 +0,0 @@ -const parser = require('../main'); - -describe("Test strings", function() { - it("fix #144", function() { - expect(parser.parseEval('"encapsed \\\" {$var}";')).toMatchSnapshot(); - }); - - describe("fix #101", function() { - it("case 1", function() { - expect(parser.parseEval('"encapsed {$var}";')).toMatchSnapshot(); - }); - - it("case 2", function() { - expect(parser.parseEval('"encapsed {$arr[0]}";')).toMatchSnapshot(); - }); - - it("case 3", function() { - expect(parser.parseEval('"encapsed ${var}";')).toMatchSnapshot(); - }); - }); - - it("fix #124", function() { - expect(parser.parseEval('$string = "He drank some $juices[koolaid1] juice.";')).toMatchSnapshot(); - }); - - it("fix #123", function() { - expect(parser.parseEval("$string = 'Avoid converting \n chars, but \\' or \\\\ is ok.';")).toMatchSnapshot(); - }); - - it("implement #116", function() { - expect(parser.parseEval(`$a = "foo\\nbar";`)).toMatchSnapshot(); - }); - - it("fix #149", function() { - expect(parser.parseEval(`$a = b"foo\\nbar";`)).toMatchSnapshot(); - }); - - it("test binary with double quotes", function() { - expect(parser.parseEval(`echo b"\\colors contains >$colors<\\n";`)).toMatchSnapshot(); - }); - - describe("check infinite on $", function() { - it("using doublequotes", function() { - expect(parser.parseEval(`echo "$`, { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - - it("using backquotes", function() { - expect(parser.parseEval("echo `$", { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - - it("with arrow", function() { - expect(parser.parseEval("echo ` -> $", { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - }); - - describe("check infinite on {", function() { - it("using doublequotes", function() { - expect(parser.parseEval(`echo "{`, { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - - it("using backquotes", function() { - expect(parser.parseEval("echo `{", { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - - it("with arrow", function() { - expect(parser.parseEval("echo ` -> {", { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - }); - - describe("check infinite on ${", function() { - it("using doublequotes", function() { - expect(parser.parseEval('echo "${', { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - - it("using backquotes", function() { - expect(parser.parseEval("echo `${", { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - - it("with arrow", function() { - expect(parser.parseEval("echo ` -> ${", { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - }); - - describe("check infinite on {$", function() { - it("using doublequotes", function() { - expect(parser.parseEval('echo "{$', { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - - it("using backquotes", function() { - expect(parser.parseEval("echo `{$", { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - - it("with arrow", function() { - expect(parser.parseEval("echo ` -> {$", { - parser: { suppressErrors: true, debug: false }, - lexer: { debug: false } - })).toMatchSnapshot(); - }); - }); - - it.skip("binary cast", function() { - expect(parser.parseEval(`echo (binary)"\\colors[1] contains >$colors[1]<\\n";`)).toMatchSnapshot(); - }); - - it("test encapsed variable", function() { - expect(parser.parseEval(` - echo "Hello $obj->name !"; - echo "Hello $obj->foo->bar !"; - echo "Hello $obj[1]->foo !"; - `)).toMatchSnapshot(); - }); - - it("encapsed variable / curly varname", function() { - expect(parser.parseEval('echo "Hello ${obj}->name !";')).toMatchSnapshot(); - }); - - it("encapsed variable / curly constant", function() { - expect(parser.parseEval('echo "Hello ${ obj }";')).toMatchSnapshot(); - }); - - it("encapsed variable / offsetlookup", function() { - expect(parser.parseEval('echo "${$parts[$i]}\\n";')).toMatchSnapshot(); - }); - - it("test double quotes", function() { - expect(parser.parseEval([ - '$a = "$";', - '$a = "{";', - '$a = "-$-";', - '$a = "-{";', - '$a = "$b";', - '$a = "{$b}";', - '$a = "${$b}";', - '$a = "-$b?";', - '$a = "-{$b}";', - '$a = "-${$b}";', - '$a = "";', - '$a = "\\"";' - ].join("\r\n"), { - lexer: { - debug: false - }, - parser: { - debug: false - } - })).toMatchSnapshot(); - }); - - it("...", function() { - var ast = parser.parseEval('echo B"\\colors[1] contains >$colors[1]<\\n";'); - }); - - it("...", function() { - var ast = parser.parseEval('echo "\\colors[1] contains >$colors [1]<\\n";'); - }); - - it("...", function() { - var ast = parser.parseEval("echo \"~'.{{$expectedLength}}'\\$~s\";"); - }); - - it("...", function() { - var ast = parser.parseEval("$a = b'\\t\\ra';"); - }); - - it("...", function() { - var ast = parser.parseEval('$foo = array("v1.09azAZ-._~!$", true);'); - }); - - it("...", function() { - var ast = parser.parseEval('$v = strtolower("$i.$j.$k-$rel");'); - }); - - it("...", function() { - var ast = parser.parseEval('$text = "$text at line $line";'); - }); - - it("...", function() { - var ast = parser.parseEval( - "return \"Class.create('$package$className',{\";" - ); - }); - - it("...", function() { - var ast = parser.parseEval("echo \"yo : {$feeds[0]['title[0][value]']}\";"); - }); - - it("...", function() { - var ast = parser.parseEval('return "\\x1B[{$color}m{$str}\\x1B[0m";'); - }); - - it("...", function() { - var ast = parser.parseEval('echo "\\"$parts[0]\\"\\n";'); - }); - - it("...", function() { - var ast = parser.parseEval('echo "Hello {".$obj->name."} !";'); - }); - - it("...", function() { - var ast = parser.parseEval('echo "Hello {$obj->name} !";'); - }); - - it("test encapsed elements", function() { - expect(parser.parseEval([ - "$code = <<<\t EOFX", - "{$this->docStar}", - "${$foo}", - "${targetDirs[1]}", - "$test[1]", - "$test->foo", - "EOFX;" - ].join("\r"), { - parser: { - debug: false - } - })).toMatchSnapshot(); - }); - - it("test nowdoc label and contents", function() { - expect(parser.parseEval(["$code .= <<<'EOF'", " }", "EOF;"].join("\r\n"), { - parser: { - debug: false - } - })).toMatchSnapshot(); - }); - - it.skip("heredoc ...", function() { - expect(parser.parseEval(` - $fallbackContent .= sprintf(<<addFallbackCatalogue(\\$catalogue%s); - EOF2 - ) - `)).toMatchSnapshot(); - }); - - it("test empty nowdoc & heredoc contents", function() { - expect(parser.parseEval(` - echo << bug ", { - parser: { - debug: false, - extractTokens: true - } - }); - expect(ast).toMatchSnapshot(); - }); -}); diff --git a/test/snapshot/variable.test.js b/test/snapshot/variable.test.js deleted file mode 100644 index 6c932254d..000000000 --- a/test/snapshot/variable.test.js +++ /dev/null @@ -1,98 +0,0 @@ -const parser = require('../main'); - -describe("Test variables", function() { - it("array destructuring", function() { - expect(parser.parseEval("[$id1, $name1] = $data[0];")).toMatchSnapshot(); - }); - - it("default variables", function() { - expect(parser.parseEval(` - $a = "foo"; - $b = &$c; - $a->b = true;` - )).toMatchSnapshot(); - }); - - it("Variable chains", function() { - expect(parser.parseEval("foo::$a[1][2];")).toMatchSnapshot(); - }); - - it("Class constants", function() { - expect(parser.parseEval(` - static::foo(); - self::foo(); - parent::foo(); - foo::class; - $this->foo(); - foo::$bar; - $this->foo::bar["baz"]::qux();` - )).toMatchSnapshot(); - }); - - it("Encaps var offset", function() { - expect(parser.parseEval(` - $a = "{$a[1]}"; - $a = "{$a["a"]}"; - $a = "{$a[$b]}";` - )).toMatchSnapshot(); - }); - - it("Chained encapsed vars", function() { - expect(parser.parseEval( - ` - $a = "{$a->foo()[$bar[$foo]]}"; - ` - )).toMatchSnapshot(); - }); - - it("Dynamic variables", function() { - expect(parser.parseEval(` - $$a = "bar"; - $$$a = "bar"; - \${$a."bar"} = "bar"; - $foo{$a."bar"} = "bar"; - `)).toMatchSnapshot(); - }); - - describe("Check errors", function() { - it("should be ?", function() { - expect(parser.parseEval("$? = true;", { - parser: { - suppressErrors: true - } - })).toMatchSnapshot(); - }); - - it("should fail on double static lookup", function() { - expect(parser.parseEval(["this->foo::bar::baz;"].join("\n"), { - parser: { - suppressErrors: true - } - })).toMatchSnapshot(); - }); - - it("should fail on property lookup on static lookup", function() { - expect(parser.parseEval(["$this->foo::bar->baz;"].join("\n"), { - parser: { - suppressErrors: true - } - })).toMatchSnapshot(); - }); - - it("should fail $foo->bar::!", function() { - expect(parser.parseEval("$foo->bar::!", { - parser: { - suppressErrors: true - } - })).toMatchSnapshot(); - }); - - it("should fail foo::bar::baz", function() { - expect(parser.parseEval("foo::bar::baz", { - parser: { - suppressErrors: true - } - })).toMatchSnapshot(); - }); - }); -}); diff --git a/tokens.js.html b/tokens.js.html new file mode 100644 index 000000000..d3dd56894 --- /dev/null +++ b/tokens.js.html @@ -0,0 +1,422 @@ + + + + + + + + + + + tokens.js - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ tokens.js +

+ + + + + +
+
+
/**
+ * Copyright (C) 2018 Glayzzle (BSD3 License)
+ * @authors https://github.com/glayzzle/php-parser/graphs/contributors
+ * @url http://glayzzle.com
+ */
+"use strict";
+
+/**
+ * PHP AST Tokens
+ * @type {Object}
+ */
+module.exports = {
+  values: {
+    101: "T_HALT_COMPILER",
+    102: "T_USE",
+    103: "T_ENCAPSED_AND_WHITESPACE",
+    104: "T_OBJECT_OPERATOR",
+    105: "T_STRING",
+    106: "T_DOLLAR_OPEN_CURLY_BRACES",
+    107: "T_STRING_VARNAME",
+    108: "T_CURLY_OPEN",
+    109: "T_NUM_STRING",
+    110: "T_ISSET",
+    111: "T_EMPTY",
+    112: "T_INCLUDE",
+    113: "T_INCLUDE_ONCE",
+    114: "T_EVAL",
+    115: "T_REQUIRE",
+    116: "T_REQUIRE_ONCE",
+    117: "T_NAMESPACE",
+    118: "T_NS_SEPARATOR",
+    119: "T_AS",
+    120: "T_IF",
+    121: "T_ENDIF",
+    122: "T_WHILE",
+    123: "T_DO",
+    124: "T_FOR",
+    125: "T_SWITCH",
+    126: "T_BREAK",
+    127: "T_CONTINUE",
+    128: "T_RETURN",
+    129: "T_GLOBAL",
+    130: "T_STATIC",
+    131: "T_ECHO",
+    132: "T_INLINE_HTML",
+    133: "T_UNSET",
+    134: "T_FOREACH",
+    135: "T_DECLARE",
+    136: "T_TRY",
+    137: "T_THROW",
+    138: "T_GOTO",
+    139: "T_FINALLY",
+    140: "T_CATCH",
+    141: "T_ENDDECLARE",
+    142: "T_LIST",
+    143: "T_CLONE",
+    144: "T_PLUS_EQUAL",
+    145: "T_MINUS_EQUAL",
+    146: "T_MUL_EQUAL",
+    147: "T_DIV_EQUAL",
+    148: "T_CONCAT_EQUAL",
+    149: "T_MOD_EQUAL",
+    150: "T_AND_EQUAL",
+    151: "T_OR_EQUAL",
+    152: "T_XOR_EQUAL",
+    153: "T_SL_EQUAL",
+    154: "T_SR_EQUAL",
+    155: "T_INC",
+    156: "T_DEC",
+    157: "T_BOOLEAN_OR",
+    158: "T_BOOLEAN_AND",
+    159: "T_LOGICAL_OR",
+    160: "T_LOGICAL_AND",
+    161: "T_LOGICAL_XOR",
+    162: "T_SL",
+    163: "T_SR",
+    164: "T_IS_IDENTICAL",
+    165: "T_IS_NOT_IDENTICAL",
+    166: "T_IS_EQUAL",
+    167: "T_IS_NOT_EQUAL",
+    168: "T_IS_SMALLER_OR_EQUAL",
+    169: "T_IS_GREATER_OR_EQUAL",
+    170: "T_INSTANCEOF",
+    171: "T_INT_CAST",
+    172: "T_DOUBLE_CAST",
+    173: "T_STRING_CAST",
+    174: "T_ARRAY_CAST",
+    175: "T_OBJECT_CAST",
+    176: "T_BOOL_CAST",
+    177: "T_UNSET_CAST",
+    178: "T_EXIT",
+    179: "T_PRINT",
+    180: "T_YIELD",
+    181: "T_YIELD_FROM",
+    182: "T_FUNCTION",
+    183: "T_DOUBLE_ARROW",
+    184: "T_DOUBLE_COLON",
+    185: "T_ARRAY",
+    186: "T_CALLABLE",
+    187: "T_CLASS",
+    188: "T_ABSTRACT",
+    189: "T_TRAIT",
+    190: "T_FINAL",
+    191: "T_EXTENDS",
+    192: "T_INTERFACE",
+    193: "T_IMPLEMENTS",
+    194: "T_VAR",
+    195: "T_PUBLIC",
+    196: "T_PROTECTED",
+    197: "T_PRIVATE",
+    198: "T_CONST",
+    199: "T_NEW",
+    200: "T_INSTEADOF",
+    201: "T_ELSEIF",
+    202: "T_ELSE",
+    203: "T_ENDSWITCH",
+    204: "T_CASE",
+    205: "T_DEFAULT",
+    206: "T_ENDFOR",
+    207: "T_ENDFOREACH",
+    208: "T_ENDWHILE",
+    209: "T_CONSTANT_ENCAPSED_STRING",
+    210: "T_LNUMBER",
+    211: "T_DNUMBER",
+    212: "T_LINE",
+    213: "T_FILE",
+    214: "T_DIR",
+    215: "T_TRAIT_C",
+    216: "T_METHOD_C",
+    217: "T_FUNC_C",
+    218: "T_NS_C",
+    219: "T_START_HEREDOC",
+    220: "T_END_HEREDOC",
+    221: "T_CLASS_C",
+    222: "T_VARIABLE",
+    223: "T_OPEN_TAG",
+    224: "T_OPEN_TAG_WITH_ECHO",
+    225: "T_CLOSE_TAG",
+    226: "T_WHITESPACE",
+    227: "T_COMMENT",
+    228: "T_DOC_COMMENT",
+    229: "T_ELLIPSIS",
+    230: "T_COALESCE",
+    231: "T_POW",
+    232: "T_POW_EQUAL",
+    233: "T_SPACESHIP"
+  },
+  names: {
+    T_HALT_COMPILER: 101,
+    T_USE: 102,
+    T_ENCAPSED_AND_WHITESPACE: 103,
+    T_OBJECT_OPERATOR: 104,
+    T_STRING: 105,
+    T_DOLLAR_OPEN_CURLY_BRACES: 106,
+    T_STRING_VARNAME: 107,
+    T_CURLY_OPEN: 108,
+    T_NUM_STRING: 109,
+    T_ISSET: 110,
+    T_EMPTY: 111,
+    T_INCLUDE: 112,
+    T_INCLUDE_ONCE: 113,
+    T_EVAL: 114,
+    T_REQUIRE: 115,
+    T_REQUIRE_ONCE: 116,
+    T_NAMESPACE: 117,
+    T_NS_SEPARATOR: 118,
+    T_AS: 119,
+    T_IF: 120,
+    T_ENDIF: 121,
+    T_WHILE: 122,
+    T_DO: 123,
+    T_FOR: 124,
+    T_SWITCH: 125,
+    T_BREAK: 126,
+    T_CONTINUE: 127,
+    T_RETURN: 128,
+    T_GLOBAL: 129,
+    T_STATIC: 130,
+    T_ECHO: 131,
+    T_INLINE_HTML: 132,
+    T_UNSET: 133,
+    T_FOREACH: 134,
+    T_DECLARE: 135,
+    T_TRY: 136,
+    T_THROW: 137,
+    T_GOTO: 138,
+    T_FINALLY: 139,
+    T_CATCH: 140,
+    T_ENDDECLARE: 141,
+    T_LIST: 142,
+    T_CLONE: 143,
+    T_PLUS_EQUAL: 144,
+    T_MINUS_EQUAL: 145,
+    T_MUL_EQUAL: 146,
+    T_DIV_EQUAL: 147,
+    T_CONCAT_EQUAL: 148,
+    T_MOD_EQUAL: 149,
+    T_AND_EQUAL: 150,
+    T_OR_EQUAL: 151,
+    T_XOR_EQUAL: 152,
+    T_SL_EQUAL: 153,
+    T_SR_EQUAL: 154,
+    T_INC: 155,
+    T_DEC: 156,
+    T_BOOLEAN_OR: 157,
+    T_BOOLEAN_AND: 158,
+    T_LOGICAL_OR: 159,
+    T_LOGICAL_AND: 160,
+    T_LOGICAL_XOR: 161,
+    T_SL: 162,
+    T_SR: 163,
+    T_IS_IDENTICAL: 164,
+    T_IS_NOT_IDENTICAL: 165,
+    T_IS_EQUAL: 166,
+    T_IS_NOT_EQUAL: 167,
+    T_IS_SMALLER_OR_EQUAL: 168,
+    T_IS_GREATER_OR_EQUAL: 169,
+    T_INSTANCEOF: 170,
+    T_INT_CAST: 171,
+    T_DOUBLE_CAST: 172,
+    T_STRING_CAST: 173,
+    T_ARRAY_CAST: 174,
+    T_OBJECT_CAST: 175,
+    T_BOOL_CAST: 176,
+    T_UNSET_CAST: 177,
+    T_EXIT: 178,
+    T_PRINT: 179,
+    T_YIELD: 180,
+    T_YIELD_FROM: 181,
+    T_FUNCTION: 182,
+    T_DOUBLE_ARROW: 183,
+    T_DOUBLE_COLON: 184,
+    T_ARRAY: 185,
+    T_CALLABLE: 186,
+    T_CLASS: 187,
+    T_ABSTRACT: 188,
+    T_TRAIT: 189,
+    T_FINAL: 190,
+    T_EXTENDS: 191,
+    T_INTERFACE: 192,
+    T_IMPLEMENTS: 193,
+    T_VAR: 194,
+    T_PUBLIC: 195,
+    T_PROTECTED: 196,
+    T_PRIVATE: 197,
+    T_CONST: 198,
+    T_NEW: 199,
+    T_INSTEADOF: 200,
+    T_ELSEIF: 201,
+    T_ELSE: 202,
+    T_ENDSWITCH: 203,
+    T_CASE: 204,
+    T_DEFAULT: 205,
+    T_ENDFOR: 206,
+    T_ENDFOREACH: 207,
+    T_ENDWHILE: 208,
+    T_CONSTANT_ENCAPSED_STRING: 209,
+    T_LNUMBER: 210,
+    T_DNUMBER: 211,
+    T_LINE: 212,
+    T_FILE: 213,
+    T_DIR: 214,
+    T_TRAIT_C: 215,
+    T_METHOD_C: 216,
+    T_FUNC_C: 217,
+    T_NS_C: 218,
+    T_START_HEREDOC: 219,
+    T_END_HEREDOC: 220,
+    T_CLASS_C: 221,
+    T_VARIABLE: 222,
+    T_OPEN_TAG: 223,
+    T_OPEN_TAG_WITH_ECHO: 224,
+    T_CLOSE_TAG: 225,
+    T_WHITESPACE: 226,
+    T_COMMENT: 227,
+    T_DOC_COMMENT: 228,
+    T_ELLIPSIS: 229,
+    T_COALESCE: 230,
+    T_POW: 231,
+    T_POW_EQUAL: 232,
+    T_SPACESHIP: 233
+  }
+};
+
+
+
+ + + + +
+ +
+ + + + + + + + + + + + diff --git a/tutorial-AST_.html b/tutorial-AST_.html new file mode 100644 index 000000000..e6fe416ec --- /dev/null +++ b/tutorial-AST_.html @@ -0,0 +1,284 @@ + + + + + + + + + Tutorial: AST - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Tutorial: AST +

+ + +
+
+ + +

+ AST +

+
+ +
+

Abstract Syntax Tree

+

You can see the AST as a DOM document, the source code of the program beeing +the graphical text output, and the DOM beeing a representation of it.

+

The main node is the program node, and it's structured like this :

+
  {
+    "kind": "program",
+    "children": [
+      // array of nodes
+    ]
+  }

Nodes

+

Every node has a common structure enabling you to scan them and act accordingly.

+

NOTE : This structure depends also on what options you enable.

+
  {
+    "kind": "node name",
+    "loc": {
+      ""
+    },
+    // the location node
+    "loc": {
+      "source": "original source code of the node",
+      "start": {
+        "line": 1, // 1 based
+        "column": 0, // 0 based
+        "offset": 0 // offset from the source code
+      },
+      "end": {
+        // same structure as start
+      }
+    },
+    "leadingComments": [
+      // array of comments nodes
+    ]
+  }

Nodes hierarchy

+ +
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/tutorial-Engine_.html b/tutorial-Engine_.html new file mode 100644 index 000000000..14c6cecde --- /dev/null +++ b/tutorial-Engine_.html @@ -0,0 +1,208 @@ + + + + + + + + + Tutorial: Engine - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Tutorial: Engine +

+ + +
+
+ + +

+ Engine +

+
+ +
+

Initialise a new parser instance with the specified options

+

Usage :

+
var parser = require('php-parser');
+var instance = new parser({
+  parser: {
+    extractDoc: true,
+    suppressErrors: true,
+    php7: true
+  },
+  ast: {
+    withPositions: true
+  },
+  lexer: {
+    short_tags: true,
+    asp_tags: true
+  }
+});
+
+var evalAST = instance.parseEval('some php code');
+var codeAST = instance.parseCode('<?php some php code', 'foo.php');
+var tokens = instance.tokenGetAll('<?php some php code');

Type: Engine

+

Parameters

+
    +
  • options Object List of options
  • +
+

Properties

+
    +
  • lexer Lexer
  • +
  • parser Parser
  • +
  • ast AST
  • +
  • tokens Object
  • +
+

parseEval

+

Parse an evaluating mode string (no need to open php tags)

+

Parameters

+ +

Returns Program

+

parseCode

+

Function that parse a php code with open/close tags

+

Sample code :

+
<?php $x = 1;

Usage :

+
var parser = require('php-parser');
+var phpParser = new parser({
+  // some options
+});
+var ast = phpParser.parseCode('...php code...', 'foo.php');

Parameters

+
    +
  • buffer String The code to be parsed
  • +
  • filename String Filename
  • +
+

Returns Program

+

tokenGetAll

+

Extract tokens from the specified buffer.

+
+

Note that the output tokens are STRICLY similar to PHP function token_get_all

+
+

Parameters

+ +

Returns Array<String> Each item can be a string or an array with following informations [token_name, text, line_number]

+

getStringBuffer

+

Check if the inpyt is a buffer or a string

+

Parameters

+
    +
  • buffer (Buffer | String) Input value that can be either a buffer or a string
  • +
+

Returns String Returns the string from input

+
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/tutorial-Options.html b/tutorial-Options.html new file mode 100644 index 000000000..412c6f4bc --- /dev/null +++ b/tutorial-Options.html @@ -0,0 +1,174 @@ + + + + + + + + + Tutorial: Options - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Tutorial: Options +

+ + +
+
+ + +

+ Options +

+
+ +
+

Options

+

When you call the parser you can pass options as following :

+
var reader = require('php-parser');
+reader.parseCode('<?php echo true;', {
+  parser: {
+    debug: false, 
+    locations: false,
+    extractDoc: false,
+    suppressErrors: false
+  },
+  ast: {
+    withPositions: true,
+    withSource: true
+  },
+  lexer: {
+    all_tokens: false,
+    comment_tokens: false,
+    mode_eval: false,
+    asp_tags: false,
+    short_tags: false
+  }
+});

Parser

+
    +
  • debug : enables debug output, useful for handling parsing errors when extending the library.
  • +
  • locations : attach location nodes to AST - see more details
  • +
  • extractDoc : extracting comments blocks - see more details
  • +
  • suppressErrors: graceful parsing mode, when an error is raised it's ignored see more details
  • +
+

Lexer

+
    +
  • all_tokens : extract all tokens (same output as token_get_all function in PHP)
  • +
  • comment_tokens: extract also comments tokens (used when all_tokens is false)
  • +
  • mode_eval: ignoring open or close tags, the input is directly a PHP script
  • +
  • asp_tags: handles ASP like tags <% and %>
  • +
  • short_tags : handle short opening tag <?
  • +
+
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/tutorial-Parser_.html b/tutorial-Parser_.html new file mode 100644 index 000000000..9e07441e3 --- /dev/null +++ b/tutorial-Parser_.html @@ -0,0 +1,442 @@ + + + + + + + + + Tutorial: Parser - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ Tutorial: Parser +

+ + +
+
+ + +

+ Parser +

+
+ +
+

The PHP Parser class that build the AST tree from the lexer

+

Type: Parser

+

Parameters

+
    +
  • lexer
  • +
  • ast
  • +
+

Properties

+
    +
  • lexer Lexer current lexer instance
  • +
  • ast AST the AST factory instance
  • +
  • token (Integer | String) current token
  • +
  • extractDoc Boolean should extract documentation as AST node
  • +
  • extractTokens Boolean should extract each token
  • +
  • suppressErrors Boolean should ignore parsing errors and continue
  • +
  • debug Boolean should output debug informations
  • +
+

getTokenName

+

helper : gets a token name

+

Parameters

+
    +
  • token
  • +
+

parse

+

main entry point : converts a source code to AST

+

Parameters

+
    +
  • code
  • +
  • filename
  • +
+

raiseError

+

Raise an error

+

Parameters

+
    +
  • message
  • +
  • msgExpect
  • +
  • expect
  • +
  • token
  • +
+

error

+

handling errors

+

Parameters

+
    +
  • expect
  • +
+

node

+

Creates a new AST node

+

Parameters

+
    +
  • name
  • +
+

expectEndOfStatement

+

expects an end of statement or end of file

+

Returns boolean

+

expect

+

Force the parser to check the current token.

+

If the current token does not match to expected token, +the an error will be raised.

+

If the suppressError mode is activated, then the error will +be added to the program error stack and this function will return false.

+

Parameters

+ +

Returns boolean

+

text

+

Returns the current token contents

+

Returns String

+

next

+

consume the next token *

+

lex

+

Eating a token

+

is

+

Check if token is of specified type

+

Parameters

+
    +
  • type
  • +
+

ignoreStack

+

outputs some debug information on current token *

+

read_array

+

Parse an array

+
array ::= T_ARRAY '(' array_pair_list ')' |
+  '[' array_pair_list ']'

read_array_pair_list

+

Reads an array entry item

+
array_pair_list ::= '&' w_variable |
+ (
+   expr (
+     T_DOUBLE_ARROW (
+       expr | '&' w_variable
+     )
+   )?
+ )

read_dim_offset

+
 dim_offset ::= expr?

read_class

+

reading a class

+
class ::= class_scope? T_CLASS T_STRING (T_EXTENDS NAMESPACE_NAME)? (T_IMPLEMENTS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' CLASS_BODY '}'

read_class_scope

+

Read the class visibility

+
  class_scope ::= (T_FINAL | T_ABSTRACT)?

read_class_body

+

Reads a class body

+
  class_body ::= (member_flags? (T_VAR | T_STRING | T_FUNCTION))*

read_variable_list

+

Reads variable list

+
 variable_list ::= (variable_declaration ',')* variable_declaration

read_constant_list

+

Reads constant list

+
 constant_list ::= T_CONST (constant_declaration ',')* constant_declaration

read_member_flags

+

Read member flags

+

Returns any array +1st index : 0 => public, 1 => protected, 2 => private +2nd index : 0 => instance member, 1 => static member +3rd index : 0 => normal, 1 => abstract member, 2 => final member

+

read_interface

+

reading an interface

+
interface ::= T_INTERFACE T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' INTERFACE_BODY '}'

read_interface_body

+

Reads an interface body

+
  interface_body ::= (member_flags? (T_CONST | T_FUNCTION))*

read_trait

+

reading a trait

+
trait ::= T_TRAIT T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' FUNCTION* '}'

read_trait_use_statement

+

reading a use statement

+
trait_use_statement ::= namespace_name (',' namespace_name)* ('{' trait_use_alias '}')?

read_trait_use_alias

+

Reading trait alias

+
trait_use_alias ::= namespace_name ( T_DOUBLE_COLON T_STRING )? (T_INSTEADOF namespace_name) | (T_AS member_flags? T_STRING)

name list : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L303 +trait adaptation : https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L742

+

read_variable_declaration

+

Reads a variable declaration

+
 variable_declaration ::= T_VARIABLE '=' scalar

read_constant_declaration

+

Reads a constant declaration

+
 constant_declaration ::= (T_STRING | IDENTIFIER) '=' expr

Returns Constant :link:

+

read_comment

+

Comments with // or # or / _ ... _ /

+

read_doc_comment

+

Comments with / *_ ... _ /

+

read_expr_item

+
Reads an expression
+ expr ::= @todo

read_new_expr

+
   new_expr ::= T_NEW (namespace_name function_argument_list) | (T_CLASS ... class declaration)

https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L850

+

read_class_name_reference

+

Reads a class name

+
class_name_reference ::= namespace_name | variable

read_assignment_list

+
  assignment_list ::= assignment_list_element (',' assignment_list_element?)*

read_assignment_list_element

+
 assignment_list_element ::= expr | expr T_DOUBLE_ARROW expr

is_reference

+

checks if current token is a reference keyword

+

is_variadic

+

checks if current token is a variadic keyword

+

read_function

+

reading a function

+
function ::= function_declaration code_block

read_function_declaration

+

reads a function declaration (without his body)

+
function_declaration ::= T_FUNCTION '&'?  T_STRING '(' parameter_list ')'

read_lexical_var

+
lexical_var ::= '&'? T_VARIABLE

read_parameter_list

+

reads a list of parameters

+
 parameter_list ::= (parameter ',')* parameter?

read_parameter

+
 parameter ::= type? '&'? T_ELLIPSIS? T_VARIABLE ('=' expr)?

read_function_argument_list

+

Reads a list of arguments

+
 function_argument_list ::= '(' (argument_list (',' argument_list)*)? ')'

read_argument_list

+
   argument_list ::= T_ELLIPSIS? expr

read_type

+

read type hinting

+
 type ::= T_ARRAY | T_CALLABLE | namespace_name

read_if

+

Reads an IF statement

+
 if ::= T_IF '(' expr ')' ':' ...

read_if_expr

+

reads an if expression : '(' expr ')'

+

read_elseif_short

+

reads an elseif (expr): statements

+

read_else_short

+

read_while

+

Reads a while statement

+
while ::= T_WHILE (statement | ':' inner_statement_list T_ENDWHILE ';')

Returns While

+

read_do

+

Reads a do / while loop

+
do ::= T_DO statement T_WHILE '(' expr ')' ';'

Returns Do

+

read_for

+

Read a for incremental loop

+
for ::= T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement
+for_statement ::= statement | ':' inner_statement_list T_ENDFOR ';'
+for_exprs ::= expr? (',' expr)*

Returns For

+

read_foreach

+

Reads a foreach loop

+
foreach ::= '(' expr T_AS foreach_variable (T_DOUBLE_ARROW foreach_variable)? ')' statement

Returns Foreach

+

read_foreach_variable

+

Reads a foreach variable statement

+
foreach_variable = variable |
+ T_LIST '(' assignment_list ')' |
+ '[' array_pair_list ']'

Returns Expression

+

read_start

+
start ::= (namespace | top_statement)*

read_namespace

+

Reads a namespace declaration block

+
namespace ::= T_NAMESPACE namespace_name? '{'
+   top_statements
+'}'
+| T_NAMESPACE namespace_name ';' top_statements

Returns Namespace

+

read_namespace_name

+

Reads a namespace name

+
 namespace_name ::= T_NS_SEPARATOR? (T_STRING T_NS_SEPARATOR)* T_STRING

Returns Identifier

+

read_use_statement

+

Reads a use statement

+
use_statement ::= T_USE
+  use_type? use_declarations |
+  use_type use_statement '{' use_declarations '}' |
+  use_statement '{' use_declarations(=>typed) '}'
+';'

Returns UseGroup

+

read_use_declaration

+

Reads a use declaration

+
use_declaration ::= use_type? namespace_name use_alias

Returns UseItem

+

read_use_declarations

+

Reads a list of use declarations

+
use_declarations ::= use_declaration (',' use_declaration)*

Returns Array<UseItem>

+

read_use_alias

+

Reads a use statement

+
use_alias ::= (T_AS T_STRING)?

Returns (String | null)

+

read_use_type

+

Reads the namespace type declaration

+
use_type ::= (T_FUNCTION | T_CONST)?

Returns (String | null) Possible values : function, const

+

resolve_special_chars

+

Unescape special chars

+

read_scalar

+
 scalar ::= T_MAGIC_CONST
+      | T_LNUMBER | T_DNUMBER
+      | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE? T_END_HEREDOC
+      | '"' encaps_list '"'
+      | T_START_HEREDOC encaps_list T_END_HEREDOC
+      | namespace_name (T_DOUBLE_COLON T_STRING)?

read_dereferencable

+

Handles the dereferencing

+

read_encapsed_string_item

+

Reads and extracts an encapsed item

+
encapsed_string_item ::= T_ENCAPSED_AND_WHITESPACE
+ | T_DOLLAR_OPEN_CURLY_BRACES expr '}'
+ | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}'
+ | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}'
+ | T_CURLY_OPEN variable '}'
+ | variable
+ | variable '[' expr ']'
+ | variable T_OBJECT_OPERATOR T_STRING

Returns (String | Variable | Expr | Lookup)

+

read_encapsed_string

+

Reads an encapsed string

+

get_magic_constant

+

Constant token

+

read_top_statements

+

reading a list of top statements (helper for top_statement*)

+
 top_statements ::= top_statement*

read_top_statement

+

reading a top statement

+
 top_statement ::=
+      namespace | function | class
+      | interface | trait
+      | use_statements | const_list
+      | statement

read_inner_statements

+

reads a list of simple inner statements (helper for inner_statement*)

+
 inner_statements ::= inner_statement*

read_const_list

+

Reads a list of constants declaration

+
  const_list ::= T_CONST T_STRING '=' expr (',' T_STRING '=' expr)* ';'

read_declare_list

+

Reads a list of constants declaration

+
  declare_list ::= T_STRING '=' expr (',' T_STRING '=' expr)*

read_inner_statement

+

reads a simple inner statement

+
 inner_statement ::= '{' inner_statements '}' | token

read_statement

+

Reads statements

+

read_code_block

+
 code_block ::= '{' (inner_statements | top_statements) '}'

read_switch

+

Reads a switch statement

+
 switch ::= T_SWITCH '(' expr ')' switch_case_list

Returns Switch

+

read_switch_case_list

+
 switch_case_list ::= '{' ';'? case_list* '}' | ':' ';'? case_list* T_ENDSWITCH ';'

read_case_list

+
  case_list ::= ((T_CASE expr) | T_DEFAULT) (':' | ';') inner_statement*

read_try

+
 try ::= T_TRY '{' inner_statement* '}'
+         (
+             T_CATCH '(' namespace_name variable ')' '{'  inner_statement* '}'
+         )*
+         (T_FINALLY '{' inner_statement* '}')?

Returns Try

+

read_short_form

+

Reads a short form of tokens

+

Parameters

+
    +
  • token Number The ending token
  • +
+

Returns Block

+

read_list

+

Helper : reads a list of tokens / sample : T_STRING ',' T_STRING ...

+
list ::= separator? ( item separator )* item

read_name_list

+

Reads a list of names separated by a comma

+
name_list ::= namespace (',' namespace)*

Sample code :

+
<?php class foo extends bar, baz { }

Returns Array<Identifier>

+

read_variable_declarations

+

Reads a list of variables declarations

+
variable_declaration ::= T_VARIABLE ('=' expr)?*
+variable_declarations ::= variable_declaration (',' variable_declaration)*

Sample code :

+
<?php class foo extends bar, baz { }

Returns (Array<Variable> | Array<Assign>) Returns an array composed by a list of variables, or +assign values

+

read_variable

+

Reads a variable

+
  variable ::= &? ...complex @todo

Some samples of parsed code :

+
 &$var                      // simple var
+ $var                      // simple var
+ classname::CONST_NAME     // dynamic class name with const retrieval
+ foo()                     // function call
+ $var->func()->property    // chained calls

read_encaps_var_offset

+

https://github.com/php/php-src/blob/493524454d66adde84e00d249d607ecd540de99f/Zend/zend_language_parser.y#L1231

+

read_reference_variable

+
 reference_variable ::=  simple_variable ('[' OFFSET ']')* | '{' EXPR '}'

+ $foo[123]; // foo is an array ==> gets its entry + $foo{1}; // foo is a string ==> get the 2nd char offset + ${'foo'}[123]; // get the dynamic var $foo + $foo[123]{1}; // gets the 2nd char from the 123 array entry +

+

read_simple_variable

+
 simple_variable ::= T_VARIABLE | '$' '{' expr '}' | '$' simple_variable
+
+
+ +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/tutorials/AST.md b/tutorials/AST.md deleted file mode 100644 index 147ec4e1a..000000000 --- a/tutorials/AST.md +++ /dev/null @@ -1,135 +0,0 @@ -# Abstract Syntax Tree - -You can see the AST as a DOM document, the source code of the program beeing -the graphical text output, and the DOM beeing a representation of it. - -The main node is the program node, and it's structured like this : - -```js - { - "kind": "program", - "children": [ - // array of nodes - ] - } -``` - -## Nodes - -Every node has a common structure enabling you to scan them and act accordingly. - -NOTE : This structure depends also on what options you enable. - -```js - { - "kind": "node name", - "loc": { - "" - }, - // the location node - "loc": { - "source": "original source code of the node", - "start": { - "line": 1, // 1 based - "column": 0, // 0 based - "offset": 0 // offset from the source code - }, - "end": { - // same structure as start - } - }, - "leadingComments": [ - // array of comments nodes - ] - } -``` - -## Nodes hierarchy - - - [Location](#location) - - [Position](#position) - - [Node](#node) - - [Identifier](#identifier) - - [TraitUse](#traituse) - - [TraitAlias](#traitalias) - - [TraitPrecedence](#traitprecedence) - - [Entry](#entry) - - [Case](#case) - - [Label](#label) - - [Comment](#comment) - - [CommentLine](#commentline) - - [CommentBlock](#commentblock) - - [Error](#error) - - [Expression](#expression) - - [Array](#array) - - [Variable](#variable) - - [Variadic](#variadic) - - [ConstRef](#constref) - - [Yield](#yield) - - [YieldFrom](#yieldfrom) - - [Lookup](#lookup) - - [PropertyLookup](#propertylookup) - - [StaticLookup](#staticlookup) - - [OffsetLookup](#offsetlookup) - - [Operation](#operation) - - [Pre](#pre) - - [Post](#post) - - [Bin](#bin) - - [Parenthesis](#parenthesis) - - [Unary](#unary) - - [Cast](#cast) - - [Literal](#literal) - - [Boolean](#boolean) - - [String](#string) - - [Number](#number) - - [Inline](#inline) - - [Magic](#magic) - - [Nowdoc](#nowdoc) - - [Encapsed](#encapsed) - - [Statement](#statement) - - [Eval](#eval) - - [Exit](#exit) - - [Halt](#halt) - - [Clone](#clone) - - [Declare](#declare) - - [Global](#global) - - [Static](#static) - - [Include](#include) - - [Assign](#assign) - - [RetIf](#retif) - - [If](#if) - - [Do](#do) - - [While](#while) - - [For](#for) - - [Foreach](#foreach) - - [Switch](#switch) - - [Goto](#goto) - - [Silent](#silent) - - [Try](#try) - - [Catch](#catch) - - [Throw](#throw) - - [Call](#call) - - [Closure](#closure) - - [New](#new) - - [UseGroup](#usegroup) - - [UseItem](#useitem) - - [Block](#block) - - [Program](#program) - - [Namespace](#namespace) - - [Sys](#sys) - - [Echo](#echo) - - [List](#list) - - [Print](#print) - - [Isset](#isset) - - [Unset](#unset) - - [Empty](#empty) - - [Declaration](#declaration) - - [Class](#class) - - [Interface](#interface) - - [Trait](#trait) - - [Constant](#constant) - - [ClassConstant](#classconstant) - - [Function](#function) - - [Method](#method) - - [Parameter](#parameter) - - [Property](#property) \ No newline at end of file diff --git a/tutorials/Engine.md b/tutorials/Engine.md deleted file mode 100644 index 4b91350a1..000000000 --- a/tutorials/Engine.md +++ /dev/null @@ -1,97 +0,0 @@ -Initialise a new parser instance with the specified options - -Usage : - -```js -var parser = require('php-parser'); -var instance = new parser({ - parser: { - extractDoc: true, - suppressErrors: true, - php7: true - }, - ast: { - withPositions: true - }, - lexer: { - short_tags: true, - asp_tags: true - } -}); - -var evalAST = instance.parseEval('some php code'); -var codeAST = instance.parseCode(' Note that the output tokens are _STRICLY_ similar to PHP function `token_get_all` - -**Parameters** - -- `buffer` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** - -Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** Each item can be a string or an array with following informations [token_name, text, line_number] - -## getStringBuffer - -Check if the inpyt is a buffer or a string - -**Parameters** - -- `buffer` **([Buffer](https://nodejs.org/api/buffer.html) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** Input value that can be either a buffer or a string - -Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returns the string from input diff --git a/tutorials/Options.md b/tutorials/Options.md deleted file mode 100644 index d7b6f02c0..000000000 --- a/tutorials/Options.md +++ /dev/null @@ -1,41 +0,0 @@ -# Options - -When you call the parser you can pass options as following : - -```js -var reader = require('php-parser'); -reader.parseCode('` -* short_tags : handle short opening tag ` public, 1 => protected, 2 => private -2nd index : 0 => instance member, 1 => static member -3rd index : 0 => normal, 1 => abstract member, 2 => final member - -## read_interface - -reading an interface - -```ebnf -interface ::= T_INTERFACE T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' INTERFACE_BODY '}' -``` - -## read_interface_body - -Reads an interface body - -```ebnf - interface_body ::= (member_flags? (T_CONST | T_FUNCTION))* -``` - -## read_trait - -reading a trait - -```ebnf -trait ::= T_TRAIT T_STRING (T_EXTENDS (NAMESPACE_NAME ',')* NAMESPACE_NAME)? '{' FUNCTION* '}' -``` - -## read_trait_use_statement - -reading a use statement - -```ebnf -trait_use_statement ::= namespace_name (',' namespace_name)* ('{' trait_use_alias '}')? -``` - -## read_trait_use_alias - -Reading trait alias - -```ebnf -trait_use_alias ::= namespace_name ( T_DOUBLE_COLON T_STRING )? (T_INSTEADOF namespace_name) | (T_AS member_flags? T_STRING) -``` - -name list : -trait adaptation : - -## read_variable_declaration - -Reads a variable declaration - -```ebnf - variable_declaration ::= T_VARIABLE '=' scalar -``` - -## read_constant_declaration - -Reads a constant declaration - -```ebnf - constant_declaration ::= (T_STRING | IDENTIFIER) '=' expr -``` - -Returns **Constant** [:link:](AST.md#constant) - -## read_comment - -Comments with // or # or / _ ... _ / - -## read_doc_comment - -Comments with / \*_ ... _ / - -## read_expr_item - -```ebnf -Reads an expression - expr ::= @todo -``` - -## read_new_expr - -```ebnf - new_expr ::= T_NEW (namespace_name function_argument_list) | (T_CLASS ... class declaration) -``` - - - -## read_class_name_reference - -Reads a class name - -```ebnf -class_name_reference ::= namespace_name | variable -``` - -## read_assignment_list - -```ebnf - assignment_list ::= assignment_list_element (',' assignment_list_element?)* -``` - -## read_assignment_list_element - -```ebnf - assignment_list_element ::= expr | expr T_DOUBLE_ARROW expr -``` - -## is_reference - -checks if current token is a reference keyword - -## is_variadic - -checks if current token is a variadic keyword - -## read_function - -reading a function - -```ebnf -function ::= function_declaration code_block -``` - -## read_function_declaration - -reads a function declaration (without his body) - -```ebnf -function_declaration ::= T_FUNCTION '&'? T_STRING '(' parameter_list ')' -``` - -## read_lexical_var - -```ebnf -lexical_var ::= '&'? T_VARIABLE -``` - -## read_parameter_list - -reads a list of parameters - -```ebnf - parameter_list ::= (parameter ',')* parameter? -``` - -## read_parameter - -```ebnf - parameter ::= type? '&'? T_ELLIPSIS? T_VARIABLE ('=' expr)? -``` - -## read_function_argument_list - -Reads a list of arguments - -```ebnf - function_argument_list ::= '(' (argument_list (',' argument_list)*)? ')' -``` - -## read_argument_list - -```ebnf - argument_list ::= T_ELLIPSIS? expr -``` - -## read_type - -read type hinting - -```ebnf - type ::= T_ARRAY | T_CALLABLE | namespace_name -``` - -## read_if - -Reads an IF statement - -```ebnf - if ::= T_IF '(' expr ')' ':' ... -``` - -## read_if_expr - -reads an if expression : '(' expr ')' - -## read_elseif_short - -reads an elseif (expr): statements - -## read_else_short - -## read_while - -Reads a while statement - -```ebnf -while ::= T_WHILE (statement | ':' inner_statement_list T_ENDWHILE ';') -``` - -Returns **While** - -## read_do - -Reads a do / while loop - -```ebnf -do ::= T_DO statement T_WHILE '(' expr ')' ';' -``` - -Returns **Do** - -## read_for - -Read a for incremental loop - -```ebnf -for ::= T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement -for_statement ::= statement | ':' inner_statement_list T_ENDFOR ';' -for_exprs ::= expr? (',' expr)* -``` - -Returns **For** - -## read_foreach - -Reads a foreach loop - -```ebnf -foreach ::= '(' expr T_AS foreach_variable (T_DOUBLE_ARROW foreach_variable)? ')' statement -``` - -Returns **Foreach** - -## read_foreach_variable - -Reads a foreach variable statement - -```ebnf -foreach_variable = variable | - T_LIST '(' assignment_list ')' | - '[' array_pair_list ']' -``` - -Returns **Expression** - -## read_start - -```ebnf -start ::= (namespace | top_statement)* -``` - -## read_namespace - -Reads a namespace declaration block - -```ebnf -namespace ::= T_NAMESPACE namespace_name? '{' - top_statements -'}' -| T_NAMESPACE namespace_name ';' top_statements -``` - -Returns **Namespace** - -## read_namespace_name - -Reads a namespace name - -```ebnf - namespace_name ::= T_NS_SEPARATOR? (T_STRING T_NS_SEPARATOR)* T_STRING -``` - -Returns **Identifier** - -## read_use_statement - -Reads a use statement - -```ebnf -use_statement ::= T_USE - use_type? use_declarations | - use_type use_statement '{' use_declarations '}' | - use_statement '{' use_declarations(=>typed) '}' -';' -``` - -Returns **UseGroup** - -## read_use_declaration - -Reads a use declaration - -```ebnf -use_declaration ::= use_type? namespace_name use_alias -``` - -Returns **UseItem** - -## read_use_declarations - -Reads a list of use declarations - -```ebnf -use_declarations ::= use_declaration (',' use_declaration)* -``` - -Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<UseItem>** - -## read_use_alias - -Reads a use statement - -```ebnf -use_alias ::= (T_AS T_STRING)? -``` - -Returns **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | null)** - -## read_use_type - -Reads the namespace type declaration - -```ebnf -use_type ::= (T_FUNCTION | T_CONST)? -``` - -Returns **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | null)** Possible values : function, const - -## resolve_special_chars - -Unescape special chars - -## read_scalar - -```ebnf - scalar ::= T_MAGIC_CONST - | T_LNUMBER | T_DNUMBER - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE? T_END_HEREDOC - | '"' encaps_list '"' - | T_START_HEREDOC encaps_list T_END_HEREDOC - | namespace_name (T_DOUBLE_COLON T_STRING)? -``` - -## read_dereferencable - -Handles the dereferencing - -## read_encapsed_string_item - -Reads and extracts an encapsed item - -```ebnf -encapsed_string_item ::= T_ENCAPSED_AND_WHITESPACE - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' - | T_CURLY_OPEN variable '}' - | variable - | variable '[' expr ']' - | variable T_OBJECT_OPERATOR T_STRING -``` - -Returns **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | Variable | Expr | Lookup)** - -## read_encapsed_string - -Reads an encapsed string - -## get_magic_constant - -Constant token - -## read_top_statements - -reading a list of top statements (helper for top_statement\*) - -```ebnf - top_statements ::= top_statement* -``` - -## read_top_statement - -reading a top statement - -```ebnf - top_statement ::= - namespace | function | class - | interface | trait - | use_statements | const_list - | statement -``` - -## read_inner_statements - -reads a list of simple inner statements (helper for inner_statement\*) - -```ebnf - inner_statements ::= inner_statement* -``` - -## read_const_list - -Reads a list of constants declaration - -```ebnf - const_list ::= T_CONST T_STRING '=' expr (',' T_STRING '=' expr)* ';' -``` - -## read_declare_list - -Reads a list of constants declaration - -```ebnf - declare_list ::= T_STRING '=' expr (',' T_STRING '=' expr)* -``` - -## read_inner_statement - -reads a simple inner statement - -```ebnf - inner_statement ::= '{' inner_statements '}' | token -``` - -## read_statement - -Reads statements - -## read_code_block - -```ebnf - code_block ::= '{' (inner_statements | top_statements) '}' -``` - -## read_switch - -Reads a switch statement - -```ebnf - switch ::= T_SWITCH '(' expr ')' switch_case_list -``` - -Returns **Switch** - -## read_switch_case_list - -```ebnf - switch_case_list ::= '{' ';'? case_list* '}' | ':' ';'? case_list* T_ENDSWITCH ';' -``` - -## read_case_list - -```ebnf - case_list ::= ((T_CASE expr) | T_DEFAULT) (':' | ';') inner_statement* -``` - -## read_try - -```ebnf - try ::= T_TRY '{' inner_statement* '}' - ( - T_CATCH '(' namespace_name variable ')' '{' inner_statement* '}' - )* - (T_FINALLY '{' inner_statement* '}')? -``` - -Returns **Try** - -## read_short_form - -Reads a short form of tokens - -**Parameters** - -* `token` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The ending token - -Returns **Block** - -## read_list - -Helper : reads a list of tokens / sample : T_STRING ',' T_STRING ... - -```ebnf -list ::= separator? ( item separator )* item -``` - -## read_name_list - -Reads a list of names separated by a comma - -```ebnf -name_list ::= namespace (',' namespace)* -``` - -Sample code : - -```php -** - -## read_variable_declarations - -Reads a list of variables declarations - -```ebnf -variable_declaration ::= T_VARIABLE ('=' expr)?* -variable_declarations ::= variable_declaration (',' variable_declaration)* -``` - -Sample code : - -```php - | [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<Assign>)** Returns an array composed by a list of variables, or -assign values - -## read_variable - -Reads a variable - -```ebnf - variable ::= &? ...complex @todo -``` - -Some samples of parsed code : - -```php - &$var // simple var - $var // simple var - classname::CONST_NAME // dynamic class name with const retrieval - foo() // function call - $var->func()->property // chained calls -``` - -## read_encaps_var_offset - - - -## read_reference_variable - -```ebnf - reference_variable ::= simple_variable ('[' OFFSET ']')* | '{' EXPR '}' -``` - - - $foo[123]; // foo is an array ==> gets its entry - $foo{1}; // foo is a string ==> get the 2nd char offset - ${'foo'}[123]; // get the dynamic var $foo - $foo[123]{1}; // gets the 2nd char from the 123 array entry - - -## read_simple_variable - -```ebnf - simple_variable ::= T_VARIABLE | '$' '{' expr '}' | '$' simple_variable -``` diff --git a/variadic.html b/variadic.html new file mode 100644 index 000000000..c4b19c503 --- /dev/null +++ b/variadic.html @@ -0,0 +1,504 @@ + + + + + + + + + variadic - Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ variadic +

+ + + + +
+
+ +

+ + variadic + +

+ + + +
+ +
+
+ + + + + + + + + + + + +

+ new variadic() +

+
+ + + + + +
+

Introduce a list of items into the arguments of the call

+
+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
what + + + + Array + + + | + + + Expression + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + + + + + + + +

+ includeToken(parser) +

+
+ + + + + +
+

Includes current token position of the parser

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
parser + + + + * + + + + + + + + + +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 5f8396165..000000000 --- a/webpack.config.js +++ /dev/null @@ -1,66 +0,0 @@ -const path = require("path"); -const webpack = require("webpack"); -const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); -const { name, description, license, author } = require("./package.json"); - -const entry = "./src/index.js"; - -const entries = { - [`${name}`]: entry, - [`${name}.min`]: entry -}; - -const today = `${new Date(Date.now()).toLocaleDateString()}`; - -module.exports = { - target: "web", - mode: "production", - entry: entries, - output: { - filename: `[name].js`, - path: path.resolve(__dirname, "dist"), - library: "PhpParser", - libraryExport: "default", - libraryTarget: "umd" - }, - module: { - rules: [ - { - test: /\.js$/, - exclude: /(node_modules|bower_components)/, - use: { - loader: "babel-loader?cacheDirectory=true" - } - } - ] - }, - optimization: { - minimize: true, - minimizer: [ - new UglifyJsPlugin({ - include: /\.min\.js$/, - sourceMap: true, - uglifyOptions: { - compress: { - keep_fnames: true - }, - sourceMap: true, - mangle: false, - maxLineLen: 1024 - } - }) - ] - }, - plugins: [ - new webpack.BannerPlugin({ - entryOnly: true, - banner: ` - Package: ${name} - ${description} - Build: [hash] - ${today} - License: ${license} - Author: ${author} - ` - }) - ] -};