Skip to content

It seems that the function definition cannot be recognized when parsing PHP. #4729

Closed Answered by kaby76
EmptyDreams asked this question in Q&A
Discussion options

You must be logged in to vote

The input to the parser defines a class with a method, not a function. Try:

<?php
function foo() {
}
$ trparse in | trtree -a
CSharp 0 in success 0.0405193
(htmlDocument (phpBlock (topStatement (functionDeclaration (Function_ "function") (identifier (Label "foo")) (OpenRoundBracket "(") (formalParameterList) (CloseRoundBracket ")") (blockStatement (OpenCurlyBracket "{") (innerStatementList) (CloseCurlyBracket "}"))))) (EOF ""))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@EmptyDreams
Comment options

Answer selected by EmptyDreams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants