cmd: add php5 flag

This commit is contained in:
z7zmey
2018-02-06 12:39:42 +02:00
parent ce9d676229
commit f546db54b6
5 changed files with 43 additions and 26 deletions

View File

@@ -12,15 +12,15 @@ import (
)
type lexer struct {
scanner.Lexer
scanner.Lexer
}
func (l *lexer) Lex(lval *yySymType) int {
return l.Lexer.Lex(lval)
return l.Lexer.Lex(lval)
}
func (lval *yySymType) Token(t token.Token) {
lval.token = t
lval.token = t
}
func newLexer(src io.Reader, fName string) *lexer {

View File

@@ -16,14 +16,14 @@ var positions position.Positions
var positionBuilder position.Builder
func Parse(src io.Reader, fName string) (node.Node, comment.Comments, position.Positions) {
yyDebug = 0
yyErrorVerbose = true
rootnode = stmt.NewStmtList([]node.Node{}) //reset
comments = comment.Comments{}
positions = position.Positions{}
positionBuilder = position.Builder{&positions}
yyParse(newLexer(src, fName))
return rootnode, comments, positions
yyDebug = 0
yyErrorVerbose = true
rootnode = stmt.NewStmtList([]node.Node{}) //reset
comments = comment.Comments{}
positions = position.Positions{}
positionBuilder = position.Builder{&positions}
yyParse(newLexer(src, fName))
return rootnode, comments, positions
}
func ListGetFirstNodeComments(list []node.Node) []comment.Comment {
@@ -37,16 +37,16 @@ func ListGetFirstNodeComments(list []node.Node) []comment.Comment {
}
type foreachVariable struct {
node node.Node
byRef bool
node node.Node
byRef bool
}
type nodesWithEndToken struct {
nodes []node.Node
endToken token.Token
nodes []node.Node
endToken token.Token
}
type boolWithToken struct {
value bool
token *token.Token
}
value bool
token *token.Token
}