php-parser
Version:
Parse PHP code from JS and returns its AST
22 lines (20 loc) • 441 B
JavaScript
/**
* 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 () {
if (this.token == this.tok.T_NAMESPACE) {
return this.read_namespace();
} else {
return this.read_top_statement();
}
},
};