@phoenix-plugin-registry/hirse.outline-list
Version:
Displays a list of the functions or definitions in the currently opened document. Works with CSS, CoffeeScript, HTML, Haxe, Jade, JavaScript, JSX, LESS, Markdown, PHP, Python, Ruby, SCSS, SVG, Stylus, and XML.
1,773 lines (1,564 loc) • 241 kB
JavaScript
/*
* php-parser version 2.0.0
* (browserified with Browserify version 14.3.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.
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.phpparser = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,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.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; };
},{}],2:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://gla*yzzle.com
*/
var Location = require('./ast/location');
var 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)
* - [Doc](#doc)
* - [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)
* ---
*/
/**
* The AST builder class
* @constructor 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(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
);
};
/**
* 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, parser) {
var start = null;
if (this.withPositions || this.withSource) {
start = this.position(parser);
}
var self = this;
// returns the node
return function() {
var location = null;
var args = Array.prototype.slice.call(arguments);
if (self.withPositions || self.withSource) {
var src = null;
if (self.withSource) {
src = parser.lexer._input.substring(
start.offset,
parser.lexer.yylloc.prev_offset
);
}
if (self.withPositions) {
location = new Location(src, start, new Position(
parser.lexer.yylloc.prev_line,
parser.lexer.yylloc.prev_column,
parser.lexer.yylloc.prev_offset
));
} 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);
if (
result.kind === 'bin' &&
result.right &&
typeof result.right.precedence === 'function'
) {
var out = result.right.precedence(result);
if (out) { // shift with precedence
result = out;
}
} else if (result.kind === 'unary') {
var out = result.precedence(result.what);
if (out) { // shift with precedence
result = out;
}
}
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/constant'),
require('./ast/constref'),
require('./ast/continue'),
require('./ast/declaration'),
require('./ast/declare'),
require('./ast/do'),
require('./ast/doc'),
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/parenthesis'),
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) {
var kind = ctor.prototype.constructor.name.toLowerCase();
if (kind[0] === '_') kind = kind.substring(1);
AST.prototype[kind] = ctor;
});
module.exports = AST;
},{"./ast/array":3,"./ast/assign":4,"./ast/bin":5,"./ast/block":6,"./ast/boolean":7,"./ast/break":8,"./ast/call":9,"./ast/case":10,"./ast/cast":11,"./ast/catch":12,"./ast/class":13,"./ast/classconstant":14,"./ast/clone":15,"./ast/closure":16,"./ast/constant":17,"./ast/constref":18,"./ast/continue":19,"./ast/declaration":20,"./ast/declare":21,"./ast/do":22,"./ast/doc":23,"./ast/echo":24,"./ast/empty":25,"./ast/encapsed":26,"./ast/entry":27,"./ast/error":28,"./ast/eval":29,"./ast/exit":30,"./ast/expression":31,"./ast/for":32,"./ast/foreach":33,"./ast/function":34,"./ast/global":35,"./ast/goto":36,"./ast/halt":37,"./ast/identifier":38,"./ast/if":39,"./ast/include":40,"./ast/inline":41,"./ast/interface":42,"./ast/isset":43,"./ast/label":44,"./ast/list":45,"./ast/literal":46,"./ast/location":47,"./ast/lookup":48,"./ast/magic":49,"./ast/method":50,"./ast/namespace":51,"./ast/new":52,"./ast/node":53,"./ast/nowdoc":54,"./ast/number":55,"./ast/offsetlookup":56,"./ast/operation":57,"./ast/parameter":58,"./ast/parenthesis":59,"./ast/position":60,"./ast/post":61,"./ast/pre":62,"./ast/print":63,"./ast/program":64,"./ast/property":65,"./ast/propertylookup":66,"./ast/retif":67,"./ast/return":68,"./ast/silent":69,"./ast/statement":70,"./ast/static":71,"./ast/staticlookup":72,"./ast/string":73,"./ast/switch":74,"./ast/sys":75,"./ast/throw":76,"./ast/trait":77,"./ast/traitalias":78,"./ast/traitprecedence":79,"./ast/traituse":80,"./ast/try":81,"./ast/unary":82,"./ast/unset":83,"./ast/usegroup":84,"./ast/useitem":85,"./ast/variable":86,"./ast/variadic":87,"./ast/while":88,"./ast/yield":89,"./ast/yieldfrom":90}],3:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Expr = require('./expression');
var KIND = 'array';
/**
* Defines an array structure
* @constructor Array
* @extends {Expression}
* @property {Entry[]} items
* @property {boolean} shortForm
*/
var Array = Expr.extends(function Array(shortForm, items, location) {
Expr.apply(this, [KIND, location]);
this.items = items;
this.shortForm = shortForm;
});
module.exports = Array;
},{"./expression":31}],4:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Statement = require('./statement');
var KIND = 'assign';
/**
* Assigns a value to the specified target
* @constructor Assign
* @extends {Statement}
* @property {Expression} left
* @property {Expression} right
* @property {String} operator
*/
var Assign = Statement.extends(function Assign(left, right, operator, location) {
Statement.apply(this, [KIND, location]);
this.operator = operator;
this.left = left;
this.right = right;
});
module.exports = Assign;
},{"./statement":70}],5:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Operation = require('./operation');
var KIND = 'bin';
// operators in ascending order of precedence
var binOperatorsPrecedence = [
['or'],
['xor'],
['and'],
// TODO: assignment / not sure that PHP allows this with expressions
['retif'],
['??'],
['||'],
['&&'],
['|'],
['^'],
['&'],
['==', '!=', '===', '!==', /* '<>', */ '<=>'],
['<', '<=', '>', '>='],
['<<', '>>'],
['+', '-', '.'],
['*', '/', '%'],
['!'],
['instanceof'],
// TODO: typecasts
// TODO: [ (array)
// TODO: clone, new
];
/*
x OP1 (y OP2 z)
z OP1 (x OP2 y)
z OP2 (x OP1 y)
*/
/**
* Binary operations
* @constructor Bin
* @extends {Operation}
* @property {String} type
* @property {Expression} left
* @property {Expression} right
*/
var Bin = Operation.extends(function Bin(type, left, right, location) {
Operation.apply(this, [KIND, location]);
this.type = type;
this.left = left;
this.right = right;
});
Bin.prototype.precedence = function(node) {
var lLevel = Bin.precedence[node.type];
var rLevel = Bin.precedence[this.type];
if (lLevel && rLevel && rLevel < lLevel) {
// shift precedence
node.right = this.left;
this.left = node;
return this;
}
};
// define nodes shifting
Bin.precedence = {};
binOperatorsPrecedence.forEach(function (list, index) {
list.forEach(function (operator) {
Bin.precedence[operator] = index + 1;
});
});
module.exports = Bin;
},{"./operation":57}],6:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Statement = require('./statement');
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, location) {
Statement.apply(this, [kind || KIND, location]);
this.children = children;
});
module.exports = Block;
},{"./statement":70}],7:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Literal = require('./literal');
var KIND = 'boolean';
/**
* Defines a boolean value (true/false)
* @constructor Boolean
* @extends {Literal}
*/
var Boolean = Literal.extends(function Boolean(value, location) {
Literal.apply(this, [KIND, value, location]);
});
module.exports = Boolean;
},{"./literal":46}],8:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Node = require('./node');
var KIND = 'break';
/**
* A break statement
* @constructor Break
* @extends {Node}
* @property {Number|Null} level
*/
var Break = Node.extends(function Break(level, location) {
Node.apply(this, [KIND, location]);
this.level = level;
});
module.exports = Break;
},{"./node":53}],9:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
var KIND = 'call';
/**
* Executes a call statement
* @constructor Call
* @extends {Statement}
* @property {Identifier|Variable|??} what
* @property {Arguments[]} arguments
*/
var Call = Statement.extends(function Call(what, args, location) {
Statement.apply(this, [KIND, location]);
this.what = what;
this.arguments = args;
});
module.exports = Call;
},{"./statement":70}],10:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Node = require('./node');
var 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
*/
var Case = Node.extends(function Case(test, body, location) {
Node.apply(this, [KIND, location]);
this.test = test;
this.body = body;
});
module.exports = Case;
},{"./node":53}],11:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Operation = require('./operation');
var KIND = 'cast';
/**
* Binary operations
* @constructor Cast
* @extends {Operation}
* @property {String} type
* @property {Expression} what
*/
var Cast = Operation.extends(function Cast(type, what, location) {
Operation.apply(this, [KIND, location]);
this.type = type;
this.what = what;
});
module.exports = Cast;
},{"./operation":57}],12:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
var 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
*/
var Catch = Statement.extends(function Catch(body, what, variable, location) {
Statement.apply(this, [KIND, location]);
this.body = body;
this.what = what;
this.variable = variable;
});
module.exports = Catch;
},{"./statement":70}],13:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Declaration = require('./declaration');
var 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
*/
var Class = Declaration.extends(function Class(name, ext, impl, body, flags, location) {
Declaration.apply(this, [KIND, name, location]);
this.isAnonymous = name ? false : true;
this.extends = ext;
this.implements = impl;
this.body = body;
this.parseFlags(flags);
});
module.exports = Class;
},{"./declaration":20}],14:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Constant = require('./constant');
var KIND = 'classconstant';
/**
* Defines a class/interface/trait constant
* @constructor ClassConstant
* @extends {Constant}
* @property {boolean} isStatic
* @property {string} visibility
*/
var ClassConstant = Constant.extends(function ClassConstant(name, value, flags, location) {
Constant.apply(this, [name, value, location]);
this.kind = KIND;
this.parseFlags(flags);
});
module.exports = ClassConstant;
},{"./constant":17}],15:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Statement = require('./statement');
var KIND = 'clone';
/**
* Defines a clone call
* @constructor Clone
* @extends {Statement}
* @property {Expression} what
*/
var Clone = Statement.extends(function Clone(what, location) {
Statement.apply(this, [KIND, location]);
this.what = what;
});
module.exports = Clone;
},{"./statement":70}],16:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
var 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
*/
var Closure = Statement.extends(function Closure(args, byref, uses, type, nullable, location) {
Statement.apply(this, [KIND, location]);
this.uses = uses;
this.arguments = args;
this.byref = byref;
this.type = type;
this.nullable = nullable;
this.body = null;
});
module.exports = Closure;
},{"./statement":70}],17:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Declaration = require('./declaration');
var KIND = 'constant';
/**
* Defines a namespace constant
* @constructor Constant
* @extends {Declaration}
* @property {Node|null} value
*/
var Constant = Declaration.extends(function Constant(name, value, location) {
Declaration.apply(this, [KIND, name, location]);
this.value = value;
});
module.exports = Constant;
},{"./declaration":20}],18:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Expr = require('./expression');
var KIND = 'constref';
/**
* A constant reference
* @constructor ConstRef
* @extends {Expression}
* @property {String|Node} name
*/
var ConstRef = Expr.extends(function ConstRef(identifier, location) {
Expr.apply(this, [KIND, location]);
this.name = identifier;
});
module.exports = ConstRef;
},{"./expression":31}],19:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Node = require('./node');
var KIND = 'continue';
/**
* A continue statement
* @constructor Continue
* @extends {Node}
* @property {Number|Null} level
*/
var Continue = Node.extends(function Continue(level, location) {
Node.apply(this, [KIND, location]);
this.level = level;
});
module.exports = Continue;
},{"./node":53}],20:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Statement = require('./statement');
var KIND = 'declaration';
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, location) {
Statement.apply(this, [kind || KIND, 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] === 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;
},{"./statement":70}],21:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Block = require('./block');
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, location) {
Block.apply(this, [KIND, body, 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;
},{"./block":6}],22:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
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, location) {
Statement.apply(this, [KIND, location]);
this.test = test;
this.body = body;
});
module.exports = Do;
},{"./statement":70}],23:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Node = require('./node');
var KIND = 'doc';
/**
* A comment or documentation
* @constructor Documentation
* @extends {Node}
* @property {Boolean} isDoc
* @property {String[]} lines
*/
var Doc = Node.extends(function Doc(isDoc, lines, location) {
Node.apply(this, [KIND, location]);
this.isDoc = isDoc;
this.lines = lines;
});
module.exports = Doc;
},{"./node":53}],24:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Sys = require('./sys');
var KIND = 'echo';
/**
* Defines system based call
* @constructor Echo
* @extends {Sys}
*/
var Echo = Sys.extends(function Echo(args, location) {
Sys.apply(this, [KIND, args, location]);
});
module.exports = Echo;
},{"./sys":75}],25:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Sys = require('./sys');
var KIND = 'empty';
/**
* Defines an empty check call
* @constructor Empty
* @extends {Sys}
*/
var Empty = Sys.extends(function Empty(args, location) {
Sys.apply(this, [KIND, args, location]);
});
module.exports = Empty;
},{"./sys":75}],26:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Literal = require('./literal');
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, type, location) {
Literal.apply(this, [KIND, value, 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;
},{"./literal":46}],27:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Node = require('./node');
var KIND = 'entry';
/**
* An array entry
* @constructor Entry
* @extends {Node}
* @property {Node|null} key
* @property {Node} value
*/
var Entry = Node.extends(function Entry(key, value, location) {
Node.apply(this, [KIND, location]);
this.key = key;
this.value = value;
});
module.exports = Entry;
},{"./node":53}],28:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Node = require('./node');
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, location) {
Node.apply(this, [KIND, location]);
this.message = message;
this.token = token;
this.line = line;
this.expected = expected;
});
module.exports = Error;
},{"./node":53}],29:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Statement = require('./statement');
var KIND = 'eval';
/**
* Defines an eval statement
* @constructor Eval
* @extends {Statement}
* @property {Node} source
*/
var Eval = Statement.extends(function Eval(source, location) {
Statement.apply(this, [KIND, location]);
this.source = source;
});
module.exports = Eval;
},{"./statement":70}],30:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Statement = require('./statement');
var KIND = 'exit';
/**
* Defines an exit / die call
* @constructor Exit
* @extends {Statement}
* @property {Node|null} status
*/
var Exit = Statement.extends(function Exit(status, location) {
Statement.apply(this, [KIND, location]);
this.status = status;
});
module.exports = Exit;
},{"./statement":70}],31:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Node = require('./node');
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, location) {
Node.apply(this, [kind || KIND, location]);
});
module.exports = Expression;
},{"./node":53}],32:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
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, location) {
Statement.apply(this, [KIND, location]);
this.init = init;
this.test = test;
this.increment = increment;
this.shortForm = shortForm;
this.body = body;
});
module.exports = For;
},{"./statement":70}],33:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
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, location) {
Statement.apply(this, [KIND, location]);
this.source = source;
this.key = key;
this.value = value;
this.shortForm = shortForm;
this.body = body;
});
module.exports = Foreach;
},{"./statement":70}],34:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Declaration = require('./declaration');
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, location) {
Declaration.apply(this, [KIND, name, location]);
this.arguments = args;
this.byref = byref;
this.type = type;
this.nullable = nullable;
this.body = null;
});
module.exports = fn;
},{"./declaration":20}],35:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
var KIND = 'global';
/**
* Imports a variable from the global scope
* @constructor Global
* @extends {Statement}
* @property {Variable[]} items
*/
var Global = Statement.extends(function Global(items, location) {
Statement.apply(this, [KIND, location]);
this.items = items;
});
module.exports = Global;
},{"./statement":70}],36:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
var KIND = 'goto';
/**
* Defines goto statement
* @constructor Goto
* @extends {Statement}
* @property {String} label
* @see {Label}
*/
var Goto = Statement.extends(function Goto(label, location) {
Statement.apply(this, [KIND, location]);
this.label = label;
});
module.exports = Goto;
},{"./statement":70}],37:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
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, location) {
Statement.apply(this, [KIND, location]);
this.after = after;
});
module.exports = Halt;
},{"./statement":70}],38:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Node = require('./node');
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, location) {
Node.apply(this, [KIND, 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;
},{"./node":53}],39:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Statement = require('./statement');
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, location) {
Statement.apply(this, [KIND, location]);
this.test = test;
this.body = body;
this.alternate = alternate;
this.shortForm = shortForm;
});
module.exports = If;
},{"./statement":70}],40:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Statement = require('./statement');
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, location) {
Statement.apply(this, [KIND, location]);
this.once = once;
this.require = require;
this.target = target;
});
module.exports = Include;
},{"./statement":70}],41:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Literal = require('./literal');
var KIND = 'inline';
/**
* Defines inline html output (treated as echo output)
* @constructor Inline
* @extends {Literal}
*/
var Inline = Literal.extends(function Inline(value, location) {
Literal.apply(this, [KIND, value, location]);
});
module.exports = Inline;
},{"./literal":46}],42:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Declaration = require('./declaration');
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, location) {
Declaration.apply(this, [KIND, name, location]);
this.extends = ext;
this.body = body;
});
module.exports = Interface;
},{"./declaration":20}],43:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Sys = require('./sys');
var KIND = 'isset';
/**
* Defines an isset call
* @constructor Isset
* @extends {Sys}
*/
var Isset = Sys.extends(function Isset(args, location) {
Sys.apply(this, [KIND, args, location]);
});
module.exports = Isset;
},{"./sys":75}],44:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
"use strict";
var Node = require('./node');
var KIND = 'label';
/**
* A label statement (referenced by goto)
* @constructor Label
* @extends {Node}
* @property {String} name
*/
var Label = Node.extends(function Label(name, location) {
Node.apply(this, [KIND, location]);
this.name = name;
});
module.exports = Label;
},{"./node":53}],45:[function(require,module,exports){
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
var Sys = require('./sys');
var KIND = 'list';
/**
* Defi