src/Parser.php (70 lines): - line 130: // TODO consider validating parameter and return types on post-parse instead so we can be more permissive - line 147: TokenKind::IterableReservedWord, TokenKind::MixedReservedWord]; // TODO update spec - line 325: // TODO warn about unhandled parse context - line 430: // TODO include optional grouping for token kinds - line 450: // TODO include optional grouping for token kinds - line 574: // TODO add error handling for the case where a namespace definition does not occur in the outer-most scope - line 661: $classNode = new ClassDeclaration(); // TODO verify not nested - line 665: $classNode->name = $this->eat($this->nameOrReservedWordTokens); // TODO should be any - line 830: // TODO: Remove the visibilityToken in a future backwards incompatible release - line 846: // TODO ParameterType? - line 852: // TODO add post-parse rule that prevents assignment - line 853: // TODO add post-parse rule that requires only last parameter be variadic - line 858: // TODO add post-parse rule that checks for invalid assignments - line 901: // TODO: Make this a reusable abstraction? - line 937: // TODO: Make this a reusable abstraction? - line 1002: // case TokenKind::CaseKeyword: // TODO update spec - line 1119: // TODO currently only supports qualified-names, but eventually parse namespace declarations - line 1123: case TokenKind::DecimalLiteralToken: // TODO merge dec, oct, hex, bin, float -> NumericLiteral - line 1205: case TokenKind::VariableName: // TODO special case $this - line 1210: case TokenKind::Name: // TODO Qualified name - line 1215: case TokenKind::DecimalLiteralToken: // TODO merge dec, oct, hex, bin, float -> NumericLiteral - line 1235: // TODO constant-expression - line 1273: // TODO: Should this check the parent type to reject `$x = static;`, `$x = static();`, etc. - line 1307: // TODO validate input token - line 1310: $expression->children = $this->getCurrentToken(); // TODO - merge string types - line 1316: // TODO validate input token - line 1327: // TODO: Reject ${var->prop} and ${(var->prop)} without rejecting ${var+otherVar} - line 1406: // TODO: investigate if this should add other uncommon types of tokens for strings/numbers mentioned in parsePrimaryExpression() - line 1557: // TODO consider allowing empty delimiter to be more tolerant - line 1572: // TODO ERROR CASE - no delimiter, but a param follows - line 1651: // TODO more tests - line 1659: : $this->eat($this->nameOrStaticOrReservedWordTokens); // TODO support keyword name - line 1703: $functionDeclaration->name = new SkippedToken($functionDeclaration->name); // TODO instead handle this during post-walk - line 1800: $ifStatement->elseIfClauses = []; // TODO - should be some standard for empty arrays vs. null? - line 1872: // TODO add error checking - line 1962: // TODO remove duplication - line 2108: // TODO: Any other operators? - line 2179: // TODO byref-assignment-expression - line 2197: // TODO conditional-expression (L) - line 2201: // TODO coalesce-expression (R) - line 2331: // TODO should this binaryExpression be wrapped in a UnaryExpression? - line 2374: $forStatement->forInitializer = $this->parseExpressionList($forStatement); // TODO spec is redundant - line 2451: // TODO should be error checking if on top level - line 2482: // TODO error for failures to parse expressions when not optional - line 2492: $tryStatement->compoundStatement = $this->parseCompoundStatement($tryStatement); // TODO verifiy this is only compound - line 2494: $tryStatement->catchClauses = []; // TODO - should be some standard for empty arrays vs. null? - line 2511: $catchClause->qualifiedNameList = $this->parseQualifiedNameCatchList($catchClause) ?? new MissingToken(TokenKind::QualifiedName, $this->token->fullStart); // TODO generate missing token or error if null - line 2596: ); // TODO simplify - line 2630: // TODO consider splitting into dollar and name. - line 2656: // TODO: Can this be changed to a non-ArrayElement in a future release? - line 2696: // TODO - parse loosely as ArrayElementList, and validate parse tree later - line 2734: $arrayElement->byRef = $this->eatOptional1(TokenKind::AmpersandToken); // TODO not okay for list expressions - line 2902: // TODO also check operand expression validity - line 2916: // TODO write tons of tests - line 2977: $this->advanceToken(); // TODO all names should be Nodes - line 2981: return $this->parseSimpleVariable($parentNode); // TODO should be simple-variable - line 3068: : null; // TODO error if used in a getter - line 3100: $scopedPropertyAccessExpression->scopeResolutionQualifier = $expression; // TODO ensure always a Node - line 3132: // TODO - add tests for this scenario - line 3254: // TODO add post-parse rule that checks for invalid assignments - line 3322: // TODO: Make this a reusable abstraction? - line 3330: $interfaceDeclaration = new InterfaceDeclaration(); // TODO verify not nested - line 3420: $namespaceDefinition->name = $this->parseQualifiedName($namespaceDefinition); // TODO only optional with compound statement block - line 3643: // TODO: CaseKeyword - line 3725: $traitSelectAndAliasClause->name = // TODO update spec - line 3729: $traitSelectAndAliasClause->modifiers = $this->parseModifiers(); // TODO accept all modifiers, verify later - line 3738: // TODO errors for insteadof/as - line 3801: // TODO add post-parse rule that checks for invalid assignments - line 3839: // TODO add post-parse rule that checks for invalid assignments - line 3915: $arrowFunction->name = new SkippedToken($arrowFunction->name); // TODO instead handle this during post-walk experiments/Lexer.php (17 lines): - line 27: // TODO figure out how to optimize memory - line 65: // TODO manage lookaheads w/ script section state - line 70: // TODO WAT - line 109: case CharacterCodes::_dot: // ..., .=, . // TODO also applies to floating point literals - line 116: case CharacterCodes::_lessThan: // <=>, <=, <<=, <<, < // TODO heredoc and nowdoc - line 131: case CharacterCodes::_colon: // : (TODO should this actually be treated as compound?) - line 132: case CharacterCodes::_comma: // , (TODO should this actually be treated as compound?) - line 145: // TODO this can be made more performant, but we're going for simple/correct first. - line 152: // TODO get rid of strtolower for perf reasons - line 324: // TODO implement - line 398: // TODO throw error if there is no number past the dot. - line 427: // TODO throw error - line 576: // TODO validate with multiple character sets - line 649: // TODO temporarily disabled template string matching - will re-enable when it's implemented properly - line 657: // TODO scan escape sequence - line 666: // TODO throw error - line 730: if (ord($text[$pos]) === CharacterCodes::_lessThan && // TODO use regex to detect newline or whitespace char src/Node.php (10 lines): - line 153: // TODO - write unit tests to prove invariants - line 178: // TODO - write unit tests to prove invariants - line 368: // TODO re-tokenize comments and whitespace - line 396: // TODO test invariant - start of next node is end of previous node - line 416: // TODO consider renaming to getSourceText - line 508: // TODO optimize performance - line 535: // TODO fix getValues - line 596: // TODO provide a way to throw errors without crashing consumer - line 620: // TODO make more efficient - line 653: * TODO - worth throwing an error here instead? src/TokenKind.php (5 lines): - line 150: const DoubleArrowToken = 257; // TODO missing from spec - line 151: const LessThanGreaterThanToken = 258; // TODO missing from spec - line 183: // TODO how to handle incremental parsing w/ this? - line 191: const BinaryReservedWord = 330; // TODO better way - line 223: // TODO type annotations - PHP7 src/TokenStringMaps.php (5 lines): - line 85: // TODO soft reserved words? - line 91: // TODO - also consider adding other constants - line 176: " TokenKind::ScriptSectionStartTag, // TODO add tests - line 184: "@" => TokenKind::AtSymbolToken, // TODO not in spec - line 188: // TODO add new tokens tools/PrintApiDocumentation.php (4 lines): - line 38: // TODO consider not having a separate classMemberDeclarations node - line 40: // TODO: Maybe ask a class directly for all its method declarations - line 50: $description = "> TODO: add doc comment\n"; - line 63: > TODO: complete documentation - in addition to the helper methods on the Node base class, src/PhpTokenizer.php (3 lines): - line 164: // TODO: TokenStringMaps::RESERVED_WORDS[$name] ?? TokenKind::Name for compatibility? - line 184: // TODO: TokenStringMaps::RESERVED_WORDS[$name] ?? TokenKind::Name for compatibility? - line 371: T_DOUBLE_ARROW => TokenKind::DoubleArrowToken, // TODO missing from spec src/Node/StringLiteral.php (2 lines): - line 29: // TODO add tests - line 37: // TODO ensure string consistency (all strings should have start / end quote) src/DiagnosticsProvider.php (1 line): - line 63: // TODO - consider also attaching parse context information to skipped tokens src/Node/QualifiedName.php (1 line): - line 150: // TODO - also handle reserved word tokens src/Node/FunctionReturnType.php (1 line): - line 14: // TODO: This may be the wrong choice if ?type can ever be mixed with other types in union types src/Node/Statement/DeclareStatement.php (1 line): - line 19: // TODO Maybe create a delimited list with a missing token instead? Probably more consistent. src/Token.php (1 line): - line 14: // TODO optimize memory - ideally this would be a struct of 4 ints tools/RenameNodeKindProperty.php (1 line): - line 39: // TODO add method to retrieve arguments or parameters array syntax-visualizer/client/package.php (1 line): - line 21: // TODO - eventually add more configuration options validation/ParserPerformance.php (1 line): - line 47: // TODO - multiple runs, calculate statistical significance src/PositionUtilities.php (1 line): - line 28: * TODO consider throwing exception instead. experiments/BenchGetDiagnostics.php (1 line): - line 12: // TODO: Multiple source files to be realistic.