How to use the php-parser.parser function in php-parser

To help you get started, we’ve selected a few php-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HvyIndustries / crane / client / src / hvy / treeBuilder.ts View on Github external
return new Promise((resolve, reject) =>
        {
            phpParser.parser.locations = true;
            phpParser.parser.docBlocks = true;
            var ast = phpParser.parseCode(text);

            this.BuildObjectTree(ast, filePath).then((tree) =>
            {
                // TODO -- Convert this to promise
                var symbolCache = this.BuildSymbolCache(tree, filePath);

                var returnObj = {
                    tree: tree,
                    symbolCache: symbolCache
                };

                // DEBUG
                console.log("Built tree for file: " + filePath);

                resolve(returnObj);
github HvyIndustries / crane / client / src / hvy / treeBuilder.ts View on Github external
return new Promise((resolve, reject) =>
        {
            phpParser.parser.locations = true;
            phpParser.parser.docBlocks = true;
            var ast = phpParser.parseCode(text);

            this.BuildObjectTree(ast, filePath).then((tree) =>
            {
                // TODO -- Convert this to promise
                var symbolCache = this.BuildSymbolCache(tree, filePath);

                var returnObj = {
                    tree: tree,
                    symbolCache: symbolCache
                };

                // DEBUG
                console.log("Built tree for file: " + filePath);

php-parser

Parse PHP code from JS and returns its AST

BSD-3-Clause
Latest version published 7 days ago

Package Health Score

82 / 100
Full package analysis