@appthreat/atom-parsetools 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +78 -0
- package/astgen.js +421 -0
- package/index.js +1 -0
- package/package.json +53 -0
- package/phpastgen.js +33 -0
- package/plugins/.gitkeep +0 -0
- package/plugins/autoload.php +22 -0
- package/plugins/bin/bundler +14 -0
- package/plugins/bin/php-parse +119 -0
- package/plugins/bin/ruby_ast_gen +14 -0
- package/plugins/composer/ClassLoader.php +579 -0
- package/plugins/composer/InstalledVersions.php +396 -0
- package/plugins/composer/LICENSE +21 -0
- package/plugins/composer/autoload_classmap.php +260 -0
- package/plugins/composer/autoload_namespaces.php +9 -0
- package/plugins/composer/autoload_psr4.php +10 -0
- package/plugins/composer/autoload_real.php +36 -0
- package/plugins/composer/autoload_static.php +286 -0
- package/plugins/composer/installed.json +65 -0
- package/plugins/composer/installed.php +32 -0
- package/plugins/log4j2.xml +13 -0
- package/plugins/nikic/php-parser/LICENSE +29 -0
- package/plugins/nikic/php-parser/README.md +225 -0
- package/plugins/nikic/php-parser/bin/php-parse +205 -0
- package/plugins/nikic/php-parser/composer.json +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +148 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Class_.php +146 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +85 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +117 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +73 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Function_.php +67 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +93 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Method.php +146 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +45 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Param.php +168 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Property.php +161 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +64 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +148 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +78 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Use_.php +49 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder.php +13 -0
- package/plugins/nikic/php-parser/lib/PhpParser/BuilderFactory.php +399 -0
- package/plugins/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +335 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Comment/Doc.php +7 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Comment.php +239 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +6 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +229 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Error.php +180 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +46 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +18 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler.php +13 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +27 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/Differ.php +164 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +64 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +286 -0
- package/plugins/nikic/php-parser/lib/PhpParser/JsonDecoder.php +103 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +251 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +56 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +47 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +44 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +76 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +23 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +62 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +23 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +67 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +105 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +25 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer.php +560 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NameContext.php +285 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Arg.php +46 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Attribute.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +29 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +14 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Const_.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +79 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +40 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +17 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +26 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +79 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +35 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +45 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +45 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +35 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +35 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +46 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr.php +9 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Identifier.php +75 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +50 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +50 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name.php +254 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/NullableType.php +28 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Param.php +60 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +77 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +80 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +28 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +157 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar.php +7 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +85 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +109 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +161 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +137 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +40 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +33 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +47 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +77 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +17 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +91 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +13 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +32 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +52 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +47 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt.php +9 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/UnionType.php +28 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +17 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +27 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node.php +151 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeAbstract.php +178 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeDumper.php +206 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeFinder.php +81 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverser.php +291 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +29 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +20 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +48 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +50 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +260 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +52 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor.php +72 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +25 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +55 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php5.php +2682 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php7.php +2898 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +148 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser.php +18 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ParserAbstract.php +1060 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ParserFactory.php +76 -0
- package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +1126 -0
- package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +1576 -0
- package/plugins/rubyastgen/.bundle/config +5 -0
- package/plugins/rubyastgen/Gemfile +12 -0
- package/plugins/rubyastgen/Gemfile.lock +34 -0
- package/plugins/rubyastgen/bundle/bundler/setup.rb +42 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/racc +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby-parse +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby-rewrite +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby_ast_gen +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/.rspec +3 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/Gemfile +10 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/LICENSE.txt +213 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/README.md +46 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/Rakefile +8 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/bin/console +11 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/bin/setup +6 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/exe/ruby_ast_gen +59 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen/node_handling.rb +232 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen/version.rb +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen.rb +140 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/ruby_ast_gen.gemspec +25 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/spec/ruby_ast_gen_spec.rb +175 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/spec/spec_helper.rb +15 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/update_version.rb +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem.build_complete +0 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem_make.out +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/racc/cparse.so +0 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/LICENSE.MIT +20 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/README.YARD.md +12 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/node.rb +268 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/processor/mixin.rb +288 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/processor.rb +12 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/sexp.rb +30 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast.rb +17 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/BSDL +22 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/COPYING +56 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/Gemfile +10 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/README.md +69 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/Rakefile +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/bin/console +14 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/bin/setup +8 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/lib/ostruct.rb +489 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/ostruct.gemspec +24 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/LICENSE.txt +26 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/bin/ruby-parse +7 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/bin/ruby-rewrite +7 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/gauntlet_parser.rb +123 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/all.rb +17 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ast/node.rb +40 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ast/processor.rb +293 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/base.rb +294 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/builders/default.rb +2351 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/clobbering_error.rb +13 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/color.rb +32 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/context.rb +51 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/current.rb +146 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/current_arg_stack.rb +46 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/deprecation.rb +13 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/diagnostic/engine.rb +104 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/diagnostic.rb +163 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/dedenter.rb +88 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/explanation.rb +55 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/literal.rb +284 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/stack_state.rb +49 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-F0.rb +12931 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-F1.rb +14884 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-strings.rb +5433 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/macruby.rb +9634 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/max_numparam_stack.rb +56 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/messages.rb +125 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/meta.rb +48 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/rewriter.rb +105 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby18.rb +9272 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby19.rb +9558 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby20.rb +10229 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby21.rb +10203 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby22.rb +10302 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby23.rb +10322 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby24.rb +10454 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby25.rb +10374 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby26.rb +10352 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby27.rb +11948 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby30.rb +12244 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby31.rb +12717 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby32.rb +12705 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby33.rb +12590 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby34.rb +12597 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/rubymotion.rb +9515 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner/ruby_parse.rb +157 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner/ruby_rewrite.rb +101 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner.rb +299 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/buffer.rb +369 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/comment/associator.rb +233 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/comment.rb +134 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/collection.rb +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/condition.rb +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/constant.rb +32 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/definition.rb +23 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/for.rb +19 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/heredoc.rb +19 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/index.rb +33 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/keyword.rb +20 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/method_definition.rb +25 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/objc_kwarg.rb +19 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/operator.rb +17 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/rescue_body.rb +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/send.rb +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/ternary.rb +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/variable.rb +31 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map.rb +186 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/range.rb +326 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/rewriter/action.rb +44 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/rewriter.rb +513 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/tree_rewriter/action.rb +243 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/tree_rewriter.rb +431 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/static_environment.rb +134 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/syntax_error.rb +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/tree_rewriter.rb +133 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/unknown_encoding_in_magic_comment_error.rb +15 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/variables_stack.rb +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/version.rb +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser.rb +91 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/parser.gemspec +43 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/BSDL +22 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/COPYING +56 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ChangeLog +846 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/TODO +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/bin/racc +320 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/en/grammar.en.rdoc +218 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/en/grammar2.en.rdoc +219 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/command.ja.html +99 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/debug.ja.rdoc +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/grammar.ja.rdoc +348 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/index.ja.html +10 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/parser.ja.rdoc +125 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/usage.ja.html +414 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +273 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/cparse.c +840 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/extconf.rb +8 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/compat.rb +33 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/debugflags.rb +60 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/exception.rb +16 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/grammar.rb +1191 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/grammarfileparser.rb +667 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/info.rb +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/iset.rb +92 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/logfilegenerator.rb +212 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parser-text.rb +644 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parser.rb +630 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parserfilegenerator.rb +473 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/sourcetext.rb +35 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/state.rb +976 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/statetransitiontable.rb +311 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/static.rb +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc.rb +6 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/ast-2.4.3.gemspec +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/ostruct-0.6.1.gemspec +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/parser-3.3.8.0.gemspec +37 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
- package/plugins/rubyastgen/setup.ps1 +4 -0
- package/plugins/rubyastgen/setup.sh +6 -0
- package/rbastgen.js +53 -0
- package/scalasem.js +365 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
final class AttributeEmulator extends TokenEmulator
|
|
8
|
+
{
|
|
9
|
+
public function getPhpVersion(): string
|
|
10
|
+
{
|
|
11
|
+
return Emulative::PHP_8_0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function isEmulationNeeded(string $code) : bool
|
|
15
|
+
{
|
|
16
|
+
return strpos($code, '#[') !== false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public function emulate(string $code, array $tokens): array
|
|
20
|
+
{
|
|
21
|
+
// We need to manually iterate and manage a count because we'll change
|
|
22
|
+
// the tokens array on the way.
|
|
23
|
+
$line = 1;
|
|
24
|
+
for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
|
|
25
|
+
if ($tokens[$i] === '#' && isset($tokens[$i + 1]) && $tokens[$i + 1] === '[') {
|
|
26
|
+
array_splice($tokens, $i, 2, [
|
|
27
|
+
[\T_ATTRIBUTE, '#[', $line]
|
|
28
|
+
]);
|
|
29
|
+
$c--;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (\is_array($tokens[$i])) {
|
|
33
|
+
$line += substr_count($tokens[$i][1], "\n");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return $tokens;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public function reverseEmulate(string $code, array $tokens): array
|
|
41
|
+
{
|
|
42
|
+
// TODO
|
|
43
|
+
return $tokens;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public function preprocessCode(string $code, array &$patches): string {
|
|
47
|
+
$pos = 0;
|
|
48
|
+
while (false !== $pos = strpos($code, '#[', $pos)) {
|
|
49
|
+
// Replace #[ with %[
|
|
50
|
+
$code[$pos] = '%';
|
|
51
|
+
$patches[] = [$pos, 'replace', '#'];
|
|
52
|
+
$pos += 2;
|
|
53
|
+
}
|
|
54
|
+
return $code;
|
|
55
|
+
}
|
|
56
|
+
}
|
package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
final class CoaleseEqualTokenEmulator extends TokenEmulator
|
|
8
|
+
{
|
|
9
|
+
public function getPhpVersion(): string
|
|
10
|
+
{
|
|
11
|
+
return Emulative::PHP_7_4;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function isEmulationNeeded(string $code): bool
|
|
15
|
+
{
|
|
16
|
+
return strpos($code, '??=') !== false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public function emulate(string $code, array $tokens): array
|
|
20
|
+
{
|
|
21
|
+
// We need to manually iterate and manage a count because we'll change
|
|
22
|
+
// the tokens array on the way
|
|
23
|
+
$line = 1;
|
|
24
|
+
for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
|
|
25
|
+
if (isset($tokens[$i + 1])) {
|
|
26
|
+
if ($tokens[$i][0] === T_COALESCE && $tokens[$i + 1] === '=') {
|
|
27
|
+
array_splice($tokens, $i, 2, [
|
|
28
|
+
[\T_COALESCE_EQUAL, '??=', $line]
|
|
29
|
+
]);
|
|
30
|
+
$c--;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (\is_array($tokens[$i])) {
|
|
35
|
+
$line += substr_count($tokens[$i][1], "\n");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return $tokens;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public function reverseEmulate(string $code, array $tokens): array
|
|
43
|
+
{
|
|
44
|
+
// ??= was not valid code previously, don't bother.
|
|
45
|
+
return $tokens;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
final class EnumTokenEmulator extends KeywordEmulator
|
|
8
|
+
{
|
|
9
|
+
public function getPhpVersion(): string
|
|
10
|
+
{
|
|
11
|
+
return Emulative::PHP_8_1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function getKeywordString(): string
|
|
15
|
+
{
|
|
16
|
+
return 'enum';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public function getKeywordToken(): int
|
|
20
|
+
{
|
|
21
|
+
return \T_ENUM;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
protected function isKeywordContext(array $tokens, int $pos): bool
|
|
25
|
+
{
|
|
26
|
+
return parent::isKeywordContext($tokens, $pos)
|
|
27
|
+
&& isset($tokens[$pos + 2])
|
|
28
|
+
&& $tokens[$pos + 1][0] === \T_WHITESPACE
|
|
29
|
+
&& $tokens[$pos + 2][0] === \T_STRING;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
class ExplicitOctalEmulator extends TokenEmulator {
|
|
8
|
+
public function getPhpVersion(): string {
|
|
9
|
+
return Emulative::PHP_8_1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public function isEmulationNeeded(string $code): bool {
|
|
13
|
+
return strpos($code, '0o') !== false || strpos($code, '0O') !== false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public function emulate(string $code, array $tokens): array {
|
|
17
|
+
for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
|
|
18
|
+
if ($tokens[$i][0] == \T_LNUMBER && $tokens[$i][1] === '0' &&
|
|
19
|
+
isset($tokens[$i + 1]) && $tokens[$i + 1][0] == \T_STRING &&
|
|
20
|
+
preg_match('/[oO][0-7]+(?:_[0-7]+)*/', $tokens[$i + 1][1])
|
|
21
|
+
) {
|
|
22
|
+
$tokenKind = $this->resolveIntegerOrFloatToken($tokens[$i + 1][1]);
|
|
23
|
+
array_splice($tokens, $i, 2, [
|
|
24
|
+
[$tokenKind, '0' . $tokens[$i + 1][1], $tokens[$i][2]],
|
|
25
|
+
]);
|
|
26
|
+
$c--;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return $tokens;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private function resolveIntegerOrFloatToken(string $str): int
|
|
33
|
+
{
|
|
34
|
+
$str = substr($str, 1);
|
|
35
|
+
$str = str_replace('_', '', $str);
|
|
36
|
+
$num = octdec($str);
|
|
37
|
+
return is_float($num) ? \T_DNUMBER : \T_LNUMBER;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public function reverseEmulate(string $code, array $tokens): array {
|
|
41
|
+
// Explicit octals were not legal code previously, don't bother.
|
|
42
|
+
return $tokens;
|
|
43
|
+
}
|
|
44
|
+
}
|
package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
final class FlexibleDocStringEmulator extends TokenEmulator
|
|
8
|
+
{
|
|
9
|
+
const FLEXIBLE_DOC_STRING_REGEX = <<<'REGEX'
|
|
10
|
+
/<<<[ \t]*(['"]?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)\1\r?\n
|
|
11
|
+
(?:.*\r?\n)*?
|
|
12
|
+
(?<indentation>\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?<separator>(?:;?[\r\n])?)/x
|
|
13
|
+
REGEX;
|
|
14
|
+
|
|
15
|
+
public function getPhpVersion(): string
|
|
16
|
+
{
|
|
17
|
+
return Emulative::PHP_7_3;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public function isEmulationNeeded(string $code) : bool
|
|
21
|
+
{
|
|
22
|
+
return strpos($code, '<<<') !== false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public function emulate(string $code, array $tokens): array
|
|
26
|
+
{
|
|
27
|
+
// Handled by preprocessing + fixup.
|
|
28
|
+
return $tokens;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public function reverseEmulate(string $code, array $tokens): array
|
|
32
|
+
{
|
|
33
|
+
// Not supported.
|
|
34
|
+
return $tokens;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public function preprocessCode(string $code, array &$patches): string {
|
|
38
|
+
if (!preg_match_all(self::FLEXIBLE_DOC_STRING_REGEX, $code, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE)) {
|
|
39
|
+
// No heredoc/nowdoc found
|
|
40
|
+
return $code;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Keep track of how much we need to adjust string offsets due to the modifications we
|
|
44
|
+
// already made
|
|
45
|
+
$posDelta = 0;
|
|
46
|
+
foreach ($matches as $match) {
|
|
47
|
+
$indentation = $match['indentation'][0];
|
|
48
|
+
$indentationStart = $match['indentation'][1];
|
|
49
|
+
|
|
50
|
+
$separator = $match['separator'][0];
|
|
51
|
+
$separatorStart = $match['separator'][1];
|
|
52
|
+
|
|
53
|
+
if ($indentation === '' && $separator !== '') {
|
|
54
|
+
// Ordinary heredoc/nowdoc
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if ($indentation !== '') {
|
|
59
|
+
// Remove indentation
|
|
60
|
+
$indentationLen = strlen($indentation);
|
|
61
|
+
$code = substr_replace($code, '', $indentationStart + $posDelta, $indentationLen);
|
|
62
|
+
$patches[] = [$indentationStart + $posDelta, 'add', $indentation];
|
|
63
|
+
$posDelta -= $indentationLen;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if ($separator === '') {
|
|
67
|
+
// Insert newline as separator
|
|
68
|
+
$code = substr_replace($code, "\n", $separatorStart + $posDelta, 0);
|
|
69
|
+
$patches[] = [$separatorStart + $posDelta, 'remove', "\n"];
|
|
70
|
+
$posDelta += 1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return $code;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
final class FnTokenEmulator extends KeywordEmulator
|
|
8
|
+
{
|
|
9
|
+
public function getPhpVersion(): string
|
|
10
|
+
{
|
|
11
|
+
return Emulative::PHP_7_4;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function getKeywordString(): string
|
|
15
|
+
{
|
|
16
|
+
return 'fn';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public function getKeywordToken(): int
|
|
20
|
+
{
|
|
21
|
+
return \T_FN;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
abstract class KeywordEmulator extends TokenEmulator
|
|
6
|
+
{
|
|
7
|
+
abstract function getKeywordString(): string;
|
|
8
|
+
abstract function getKeywordToken(): int;
|
|
9
|
+
|
|
10
|
+
public function isEmulationNeeded(string $code): bool
|
|
11
|
+
{
|
|
12
|
+
return strpos(strtolower($code), $this->getKeywordString()) !== false;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
protected function isKeywordContext(array $tokens, int $pos): bool
|
|
16
|
+
{
|
|
17
|
+
$previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos);
|
|
18
|
+
return $previousNonSpaceToken === null || $previousNonSpaceToken[0] !== \T_OBJECT_OPERATOR;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public function emulate(string $code, array $tokens): array
|
|
22
|
+
{
|
|
23
|
+
$keywordString = $this->getKeywordString();
|
|
24
|
+
foreach ($tokens as $i => $token) {
|
|
25
|
+
if ($token[0] === T_STRING && strtolower($token[1]) === $keywordString
|
|
26
|
+
&& $this->isKeywordContext($tokens, $i)) {
|
|
27
|
+
$tokens[$i][0] = $this->getKeywordToken();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return $tokens;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @param mixed[] $tokens
|
|
36
|
+
* @return array|string|null
|
|
37
|
+
*/
|
|
38
|
+
private function getPreviousNonSpaceToken(array $tokens, int $start)
|
|
39
|
+
{
|
|
40
|
+
for ($i = $start - 1; $i >= 0; --$i) {
|
|
41
|
+
if ($tokens[$i][0] === T_WHITESPACE) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return $tokens[$i];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public function reverseEmulate(string $code, array $tokens): array
|
|
52
|
+
{
|
|
53
|
+
$keywordToken = $this->getKeywordToken();
|
|
54
|
+
foreach ($tokens as $i => $token) {
|
|
55
|
+
if ($token[0] === $keywordToken) {
|
|
56
|
+
$tokens[$i][0] = \T_STRING;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return $tokens;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
final class MatchTokenEmulator extends KeywordEmulator
|
|
8
|
+
{
|
|
9
|
+
public function getPhpVersion(): string
|
|
10
|
+
{
|
|
11
|
+
return Emulative::PHP_8_0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function getKeywordString(): string
|
|
15
|
+
{
|
|
16
|
+
return 'match';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public function getKeywordToken(): int
|
|
20
|
+
{
|
|
21
|
+
return \T_MATCH;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
final class NullsafeTokenEmulator extends TokenEmulator
|
|
8
|
+
{
|
|
9
|
+
public function getPhpVersion(): string
|
|
10
|
+
{
|
|
11
|
+
return Emulative::PHP_8_0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function isEmulationNeeded(string $code): bool
|
|
15
|
+
{
|
|
16
|
+
return strpos($code, '?->') !== false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public function emulate(string $code, array $tokens): array
|
|
20
|
+
{
|
|
21
|
+
// We need to manually iterate and manage a count because we'll change
|
|
22
|
+
// the tokens array on the way
|
|
23
|
+
$line = 1;
|
|
24
|
+
for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
|
|
25
|
+
if ($tokens[$i] === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1][0] === \T_OBJECT_OPERATOR) {
|
|
26
|
+
array_splice($tokens, $i, 2, [
|
|
27
|
+
[\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line]
|
|
28
|
+
]);
|
|
29
|
+
$c--;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Handle ?-> inside encapsed string.
|
|
34
|
+
if ($tokens[$i][0] === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1])
|
|
35
|
+
&& $tokens[$i - 1][0] === \T_VARIABLE
|
|
36
|
+
&& preg_match('/^\?->([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)/', $tokens[$i][1], $matches)
|
|
37
|
+
) {
|
|
38
|
+
$replacement = [
|
|
39
|
+
[\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line],
|
|
40
|
+
[\T_STRING, $matches[1], $line],
|
|
41
|
+
];
|
|
42
|
+
if (\strlen($matches[0]) !== \strlen($tokens[$i][1])) {
|
|
43
|
+
$replacement[] = [
|
|
44
|
+
\T_ENCAPSED_AND_WHITESPACE,
|
|
45
|
+
\substr($tokens[$i][1], \strlen($matches[0])),
|
|
46
|
+
$line
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
array_splice($tokens, $i, 1, $replacement);
|
|
50
|
+
$c += \count($replacement) - 1;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (\is_array($tokens[$i])) {
|
|
55
|
+
$line += substr_count($tokens[$i][1], "\n");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return $tokens;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public function reverseEmulate(string $code, array $tokens): array
|
|
63
|
+
{
|
|
64
|
+
// ?-> was not valid code previously, don't bother.
|
|
65
|
+
return $tokens;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
final class NumericLiteralSeparatorEmulator extends TokenEmulator
|
|
8
|
+
{
|
|
9
|
+
const BIN = '(?:0b[01]+(?:_[01]+)*)';
|
|
10
|
+
const HEX = '(?:0x[0-9a-f]+(?:_[0-9a-f]+)*)';
|
|
11
|
+
const DEC = '(?:[0-9]+(?:_[0-9]+)*)';
|
|
12
|
+
const SIMPLE_FLOAT = '(?:' . self::DEC . '\.' . self::DEC . '?|\.' . self::DEC . ')';
|
|
13
|
+
const EXP = '(?:e[+-]?' . self::DEC . ')';
|
|
14
|
+
const FLOAT = '(?:' . self::SIMPLE_FLOAT . self::EXP . '?|' . self::DEC . self::EXP . ')';
|
|
15
|
+
const NUMBER = '~' . self::FLOAT . '|' . self::BIN . '|' . self::HEX . '|' . self::DEC . '~iA';
|
|
16
|
+
|
|
17
|
+
public function getPhpVersion(): string
|
|
18
|
+
{
|
|
19
|
+
return Emulative::PHP_7_4;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public function isEmulationNeeded(string $code) : bool
|
|
23
|
+
{
|
|
24
|
+
return preg_match('~[0-9]_[0-9]~', $code)
|
|
25
|
+
|| preg_match('~0x[0-9a-f]+_[0-9a-f]~i', $code);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public function emulate(string $code, array $tokens): array
|
|
29
|
+
{
|
|
30
|
+
// We need to manually iterate and manage a count because we'll change
|
|
31
|
+
// the tokens array on the way
|
|
32
|
+
$codeOffset = 0;
|
|
33
|
+
for ($i = 0, $c = count($tokens); $i < $c; ++$i) {
|
|
34
|
+
$token = $tokens[$i];
|
|
35
|
+
$tokenLen = \strlen(\is_array($token) ? $token[1] : $token);
|
|
36
|
+
|
|
37
|
+
if ($token[0] !== T_LNUMBER && $token[0] !== T_DNUMBER) {
|
|
38
|
+
$codeOffset += $tokenLen;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
$res = preg_match(self::NUMBER, $code, $matches, 0, $codeOffset);
|
|
43
|
+
assert($res, "No number at number token position");
|
|
44
|
+
|
|
45
|
+
$match = $matches[0];
|
|
46
|
+
$matchLen = \strlen($match);
|
|
47
|
+
if ($matchLen === $tokenLen) {
|
|
48
|
+
// Original token already holds the full number.
|
|
49
|
+
$codeOffset += $tokenLen;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
$tokenKind = $this->resolveIntegerOrFloatToken($match);
|
|
54
|
+
$newTokens = [[$tokenKind, $match, $token[2]]];
|
|
55
|
+
|
|
56
|
+
$numTokens = 1;
|
|
57
|
+
$len = $tokenLen;
|
|
58
|
+
while ($matchLen > $len) {
|
|
59
|
+
$nextToken = $tokens[$i + $numTokens];
|
|
60
|
+
$nextTokenText = \is_array($nextToken) ? $nextToken[1] : $nextToken;
|
|
61
|
+
$nextTokenLen = \strlen($nextTokenText);
|
|
62
|
+
|
|
63
|
+
$numTokens++;
|
|
64
|
+
if ($matchLen < $len + $nextTokenLen) {
|
|
65
|
+
// Split trailing characters into a partial token.
|
|
66
|
+
assert(is_array($nextToken), "Partial token should be an array token");
|
|
67
|
+
$partialText = substr($nextTokenText, $matchLen - $len);
|
|
68
|
+
$newTokens[] = [$nextToken[0], $partialText, $nextToken[2]];
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
$len += $nextTokenLen;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
array_splice($tokens, $i, $numTokens, $newTokens);
|
|
76
|
+
$c -= $numTokens - \count($newTokens);
|
|
77
|
+
$codeOffset += $matchLen;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return $tokens;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private function resolveIntegerOrFloatToken(string $str): int
|
|
84
|
+
{
|
|
85
|
+
$str = str_replace('_', '', $str);
|
|
86
|
+
|
|
87
|
+
if (stripos($str, '0b') === 0) {
|
|
88
|
+
$num = bindec($str);
|
|
89
|
+
} elseif (stripos($str, '0x') === 0) {
|
|
90
|
+
$num = hexdec($str);
|
|
91
|
+
} elseif (stripos($str, '0') === 0 && ctype_digit($str)) {
|
|
92
|
+
$num = octdec($str);
|
|
93
|
+
} else {
|
|
94
|
+
$num = +$str;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return is_float($num) ? T_DNUMBER : T_LNUMBER;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
public function reverseEmulate(string $code, array $tokens): array
|
|
101
|
+
{
|
|
102
|
+
// Numeric separators were not legal code previously, don't bother.
|
|
103
|
+
return $tokens;
|
|
104
|
+
}
|
|
105
|
+
}
|
package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* In PHP 8.1, "readonly(" was special cased in the lexer in order to support functions with
|
|
9
|
+
* name readonly. In PHP 8.2, this may conflict with readonly properties having a DNF type. For
|
|
10
|
+
* this reason, PHP 8.2 instead treats this as T_READONLY and then handles it specially in the
|
|
11
|
+
* parser. This emulator only exists to handle this special case, which is skipped by the
|
|
12
|
+
* PHP 8.1 ReadonlyTokenEmulator.
|
|
13
|
+
*/
|
|
14
|
+
class ReadonlyFunctionTokenEmulator extends KeywordEmulator {
|
|
15
|
+
public function getKeywordString(): string {
|
|
16
|
+
return 'readonly';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public function getKeywordToken(): int {
|
|
20
|
+
return \T_READONLY;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public function getPhpVersion(): string {
|
|
24
|
+
return Emulative::PHP_8_2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public function reverseEmulate(string $code, array $tokens): array {
|
|
28
|
+
// Don't bother
|
|
29
|
+
return $tokens;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
use PhpParser\Lexer\Emulative;
|
|
6
|
+
|
|
7
|
+
final class ReadonlyTokenEmulator extends KeywordEmulator
|
|
8
|
+
{
|
|
9
|
+
public function getPhpVersion(): string
|
|
10
|
+
{
|
|
11
|
+
return Emulative::PHP_8_1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function getKeywordString(): string
|
|
15
|
+
{
|
|
16
|
+
return 'readonly';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public function getKeywordToken(): int
|
|
20
|
+
{
|
|
21
|
+
return \T_READONLY;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
protected function isKeywordContext(array $tokens, int $pos): bool
|
|
25
|
+
{
|
|
26
|
+
if (!parent::isKeywordContext($tokens, $pos)) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
// Support "function readonly("
|
|
30
|
+
return !(isset($tokens[$pos + 1]) &&
|
|
31
|
+
($tokens[$pos + 1][0] === '(' ||
|
|
32
|
+
($tokens[$pos + 1][0] === \T_WHITESPACE &&
|
|
33
|
+
isset($tokens[$pos + 2]) &&
|
|
34
|
+
$tokens[$pos + 2][0] === '(')));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Reverses emulation direction of the inner emulator.
|
|
7
|
+
*/
|
|
8
|
+
final class ReverseEmulator extends TokenEmulator
|
|
9
|
+
{
|
|
10
|
+
/** @var TokenEmulator Inner emulator */
|
|
11
|
+
private $emulator;
|
|
12
|
+
|
|
13
|
+
public function __construct(TokenEmulator $emulator) {
|
|
14
|
+
$this->emulator = $emulator;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public function getPhpVersion(): string {
|
|
18
|
+
return $this->emulator->getPhpVersion();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public function isEmulationNeeded(string $code): bool {
|
|
22
|
+
return $this->emulator->isEmulationNeeded($code);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public function emulate(string $code, array $tokens): array {
|
|
26
|
+
return $this->emulator->reverseEmulate($code, $tokens);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public function reverseEmulate(string $code, array $tokens): array {
|
|
30
|
+
return $this->emulator->emulate($code, $tokens);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public function preprocessCode(string $code, array &$patches): string {
|
|
34
|
+
return $code;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<?php declare(strict_types=1);
|
|
2
|
+
|
|
3
|
+
namespace PhpParser\Lexer\TokenEmulator;
|
|
4
|
+
|
|
5
|
+
/** @internal */
|
|
6
|
+
abstract class TokenEmulator
|
|
7
|
+
{
|
|
8
|
+
abstract public function getPhpVersion(): string;
|
|
9
|
+
|
|
10
|
+
abstract public function isEmulationNeeded(string $code): bool;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @return array Modified Tokens
|
|
14
|
+
*/
|
|
15
|
+
abstract public function emulate(string $code, array $tokens): array;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @return array Modified Tokens
|
|
19
|
+
*/
|
|
20
|
+
abstract public function reverseEmulate(string $code, array $tokens): array;
|
|
21
|
+
|
|
22
|
+
public function preprocessCode(string $code, array &$patches): string {
|
|
23
|
+
return $code;
|
|
24
|
+
}
|
|
25
|
+
}
|