Summary: 126 instances, 117 unique Text Count const BinaryReservedWord = 330; // TODO better way 1 // TODO byref-assignment-expression 1 // TODO figure out how to optimize memory 1 // TODO get rid of strtolower for perf reasons 1 $traitSelectAndAliasClause->modifiers = $this->parseModifiers(); // TODO accept all modifiers, verify later 1 // TODO test invariant - start of next node is end of previous node 1 // TODO: CaseKeyword 1 // TODO should this binaryExpression be wrapped in a UnaryExpression? 1 $description = "> TODO: add doc comment\n"; 1 $forStatement->forInitializer = $this->parseExpressionList($forStatement); // TODO spec is redundant 1 : null; // TODO error if used in a getter 1 // TODO - eventually add more configuration options 1 // TODO manage lookaheads w/ script section state 1 // TODO this can be made more performant, but we're going for simple/correct first. 1 // TODO add new tokens 1 return $this->parseSimpleVariable($parentNode); // TODO should be simple-variable 1 // TODO coalesce-expression (R) 1 // TODO optimize performance 1 // TODO warn about unhandled parse context 1 // TODO constant-expression 1 // TODO consider renaming to getSourceText 1 // TODO - add tests for this scenario 1 $arrowFunction->name = new SkippedToken($arrowFunction->name); // TODO instead handle this during post-walk 1 // TODO how to handle incremental parsing w/ this? 1 case CharacterCodes::_dot: // ..., .=, . // TODO also applies to floating point literals 1 // TODO: investigate if this should add other uncommon types of tokens for strings/numbers mentioned in parsePrimaryExpression() 1 // TODO consider validating parameter and return types on post-parse instead so we can be more permissive 1 $scopedPropertyAccessExpression->scopeResolutionQualifier = $expression; // TODO ensure always a Node 1 // TODO: Should this check the parent type to reject `$x = static;`, `$x = static();`, etc. 1 // TODO consider splitting into dollar and name. 1 // TODO error for failures to parse expressions when not optional 1 case TokenKind::Name: // TODO Qualified name 1 // TODO implement 1 // TODO - consider also attaching parse context information to skipped tokens 1 "@" => TokenKind::AtSymbolToken, // TODO not in spec 1 // TODO: Remove the visibilityToken in a future backwards incompatible release 1 // TODO remove duplication 1 $classNode->name = $this->eat($this->nameOrReservedWordTokens); // TODO should be any 1 // TODO should be error checking if on top level 1 > TODO: complete documentation - in addition to the helper methods on the Node base class, 1 // TODO provide a way to throw errors without crashing consumer 1 // TODO add tests 1 // TODO temporarily disabled template string matching - will re-enable when it's implemented properly 1 // TODO add post-parse rule that prevents assignment 1 $arrayElement->byRef = $this->eatOptional1(TokenKind::AmpersandToken); // TODO not okay for list expressions 1 case TokenKind::DecimalLiteralToken: // TODO merge dec, oct, hex, bin, float -> NumericLiteral 1 // TODO type annotations - PHP7 1 const LessThanGreaterThanToken = 258; // TODO missing from spec 1 // TODO write tons of tests 1 // case TokenKind::CaseKeyword: // TODO update spec 1 case TokenKind::VariableName: // TODO special case $this 1 $namespaceDefinition->name = $this->parseQualifiedName($namespaceDefinition); // TODO only optional with compound statement block 1 // TODO ParameterType? 1 // TODO optimize memory - ideally this would be a struct of 4 ints 1 // TODO add method to retrieve arguments or parameters array 1 // TODO conditional-expression (L) 1 $tryStatement->catchClauses = []; // TODO - should be some standard for empty arrays vs. null? 1 $ifStatement->elseIfClauses = []; // TODO - should be some standard for empty arrays vs. null? 1 // TODO also check operand expression validity 1 TokenKind::IterableReservedWord, TokenKind::MixedReservedWord]; // TODO update spec 1 // TODO throw error 2 // TODO include optional grouping for token kinds 2 // TODO: Reject ${var->prop} and ${(var->prop)} without rejecting ${var+otherVar} 1 // TODO: Can this be changed to a non-ArrayElement in a future release? 1 // TODO - write unit tests to prove invariants 2 // TODO fix getValues 1 $tryStatement->compoundStatement = $this->parseCompoundStatement($tryStatement); // TODO verifiy this is only compound 1 $functionDeclaration->name = new SkippedToken($functionDeclaration->name); // TODO instead handle this during post-walk 1 case CharacterCodes::_lessThan: // <=>, <=, <<=, <<, < // TODO heredoc and nowdoc 1 // TODO add error handling for the case where a namespace definition does not occur in the outer-most scope 1 // TODO: Any other operators? 1 $this->advanceToken(); // TODO all names should be Nodes 1 $expression->children = $this->getCurrentToken(); // TODO - merge string types 1 // TODO make more efficient 1 // TODO: This may be the wrong choice if ?type can ever be mixed with other types in union types 1 case CharacterCodes::_colon: // : (TODO should this actually be treated as compound?) 1 // TODO: TokenStringMaps::RESERVED_WORDS[$name] ?? TokenKind::Name for compatibility? 2 T_DOUBLE_ARROW => TokenKind::DoubleArrowToken, // TODO missing from spec 1 " TokenKind::ScriptSectionStartTag, // TODO add tests 1 // TODO add error checking 1 // TODO: Make this a reusable abstraction? 3 // TODO more tests 1 // TODO errors for insteadof/as 1 if (ord($text[$pos]) === CharacterCodes::_lessThan && // TODO use regex to detect newline or whitespace char 1 // TODO - parse loosely as ArrayElementList, and validate parse tree later 1 // TODO validate with multiple character sets 1 // TODO throw error if there is no number past the dot. 1 $interfaceDeclaration = new InterfaceDeclaration(); // TODO verify not nested 1 $classNode = new ClassDeclaration(); // TODO verify not nested 1 // TODO soft reserved words? 1 // TODO currently only supports qualified-names, but eventually parse namespace declarations 1 const DoubleArrowToken = 257; // TODO missing from spec 1 case CharacterCodes::_comma: // , (TODO should this actually be treated as compound?) 1 : $this->eat($this->nameOrStaticOrReservedWordTokens); // TODO support keyword name 1 // TODO: Multiple source files to be realistic. 1 ); // TODO simplify 1 // TODO ensure string consistency (all strings should have start / end quote) 1 $catchClause->qualifiedNameList = $this->parseQualifiedNameCatchList($catchClause) ?? new MissingToken(TokenKind::QualifiedName, $this->token->fullStart); // TODO generate missing token or error if null 1 // TODO WAT 1 // TODO re-tokenize comments and whitespace 1 // TODO validate input token 2 // TODO - multiple runs, calculate statistical significance 1 // TODO scan escape sequence 1 * TODO - worth throwing an error here instead? 1 // TODO add post-parse rule that requires only last parameter be variadic 1 // TODO: Maybe ask a class directly for all its method declarations 1 case TokenKind::DecimalLiteralToken: // TODO merge dec, oct, hex, bin, float -> NumericLiteral 1 // TODO ERROR CASE - no delimiter, but a param follows 1 * TODO consider throwing exception instead. 1 // TODO Maybe create a delimited list with a missing token instead? Probably more consistent. 1 // TODO - also handle reserved word tokens 1 // TODO add post-parse rule that checks for invalid assignments 2 $traitSelectAndAliasClause->name = // TODO update spec 1 // TODO consider allowing empty delimiter to be more tolerant 1 // TODO consider not having a separate classMemberDeclarations node 1 // TODO - also consider adding other constants 1 // TODO add post-parse rule that checks for invalid assignments 2