@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Team AppThreat
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Introduction
|
|
2
|
+
|
|
3
|
+
This package hosts a collection of parsing tools that complement the `@appthreat/atom` project. These tools offer parsing and analysis-related functionalities such as generating AST and semantics information in JSON format. The full list of tools and bin commands exposed by this package is below:
|
|
4
|
+
|
|
5
|
+
- astgen - Generates AST for JavaScript and TypeScript projects in JSON format
|
|
6
|
+
- phpastgen - Generates AST for PHP projects using `php-parse` command from `nikic/php-parser`
|
|
7
|
+
- rbastgen - Generates AST for Ruby projects using the AppThreat's `ruby_ast_gen` gem
|
|
8
|
+
- scalasem - Generates a custom semantics slice for Scala Projects by utilising scalac command.
|
|
9
|
+
|
|
10
|
+
## Command usages
|
|
11
|
+
|
|
12
|
+
### astgen
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
node astgen.js -h
|
|
16
|
+
Options:
|
|
17
|
+
-i, --src Source directory [default: "."]
|
|
18
|
+
-o, --output Output directory for generated AST JSON files
|
|
19
|
+
[default: "ast_out"]
|
|
20
|
+
-t, --type Project type. Default auto-detect
|
|
21
|
+
-r, --recurse Recurse mode suitable for mono-repos [boolean] [default: true]
|
|
22
|
+
--tsTypes Generate type mappings using the TypeScript Compiler API
|
|
23
|
+
[boolean] [default: true]
|
|
24
|
+
--version Show version number [boolean]
|
|
25
|
+
-h Show help [boolean]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### phpastgen
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
node phpastgen.js --help
|
|
32
|
+
|
|
33
|
+
Usage: phpastgen [operations] file1.php [file2.php ...]
|
|
34
|
+
or: phpastgen [operations] "<?php code"
|
|
35
|
+
Turn PHP source code into an abstract syntax tree.
|
|
36
|
+
|
|
37
|
+
Operations is a list of the following options (--dump by default):
|
|
38
|
+
|
|
39
|
+
-d, --dump Dump nodes using NodeDumper
|
|
40
|
+
-p, --pretty-print Pretty print file using PrettyPrinter\Standard
|
|
41
|
+
-j, --json-dump Print json_encode() result
|
|
42
|
+
--var-dump var_dump() nodes (for exact structure)
|
|
43
|
+
-N, --resolve-names Resolve names using NodeVisitor\NameResolver
|
|
44
|
+
-c, --with-column-info Show column numbers for errors (if available)
|
|
45
|
+
-P, --with-positions Show positions in node dumps
|
|
46
|
+
-r, --with-recovery Use parsing with error recovery
|
|
47
|
+
-h, --help Display this page
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### rbastgen
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
node rbastgen.js --help
|
|
55
|
+
Usage:
|
|
56
|
+
-i, --input The input file or directory (required)
|
|
57
|
+
-o, --output The output directory (default: '.ast')
|
|
58
|
+
-e, --exclude The exclusion regex (default: '^(tests?|vendor|spec)')
|
|
59
|
+
-d, --debug Enable debug logging
|
|
60
|
+
--version Print the version
|
|
61
|
+
--help Print usage
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### scalasem
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
scalasem <directory> <slices_file>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Example:
|
|
71
|
+
|
|
72
|
+
```shell
|
|
73
|
+
scalasem $(pwd) slices.json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT
|
package/astgen.js
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { join, dirname } from "path";
|
|
4
|
+
import yargs from "yargs";
|
|
5
|
+
import { hideBin } from "yargs/helpers";
|
|
6
|
+
import { parse } from "@babel/parser";
|
|
7
|
+
import tsc from "typescript";
|
|
8
|
+
import {
|
|
9
|
+
readFileSync,
|
|
10
|
+
mkdirSync,
|
|
11
|
+
writeFileSync,
|
|
12
|
+
accessSync,
|
|
13
|
+
constants,
|
|
14
|
+
existsSync
|
|
15
|
+
} from "fs";
|
|
16
|
+
import { getAllFiles } from "@appthreat/atom-common";
|
|
17
|
+
|
|
18
|
+
const ASTGEN_VERSION = "4.0.0";
|
|
19
|
+
|
|
20
|
+
const babelParserOptions = {
|
|
21
|
+
sourceType: "unambiguous",
|
|
22
|
+
allowImportExportEverywhere: true,
|
|
23
|
+
allowAwaitOutsideFunction: true,
|
|
24
|
+
allowNewTargetOutsideFunction: true,
|
|
25
|
+
allowReturnOutsideFunction: true,
|
|
26
|
+
allowSuperOutsideMethod: true,
|
|
27
|
+
allowUndeclaredExports: true,
|
|
28
|
+
errorRecovery: true,
|
|
29
|
+
plugins: [
|
|
30
|
+
"optionalChaining",
|
|
31
|
+
"classProperties",
|
|
32
|
+
"decorators-legacy",
|
|
33
|
+
"exportDefaultFrom",
|
|
34
|
+
"doExpressions",
|
|
35
|
+
"numericSeparator",
|
|
36
|
+
"dynamicImport",
|
|
37
|
+
"jsx",
|
|
38
|
+
"typescript"
|
|
39
|
+
]
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const babelSafeParserOptions = {
|
|
43
|
+
sourceType: "module",
|
|
44
|
+
allowImportExportEverywhere: true,
|
|
45
|
+
allowAwaitOutsideFunction: true,
|
|
46
|
+
allowReturnOutsideFunction: true,
|
|
47
|
+
errorRecovery: true,
|
|
48
|
+
plugins: [
|
|
49
|
+
"optionalChaining",
|
|
50
|
+
"classProperties",
|
|
51
|
+
"decorators-legacy",
|
|
52
|
+
"exportDefaultFrom",
|
|
53
|
+
"doExpressions",
|
|
54
|
+
"numericSeparator",
|
|
55
|
+
"dynamicImport",
|
|
56
|
+
"typescript"
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Return paths to all (j|tsx?) files.
|
|
62
|
+
*/
|
|
63
|
+
const getAllSrcJSAndTSFiles = (src) =>
|
|
64
|
+
Promise.all([
|
|
65
|
+
getAllFiles(
|
|
66
|
+
src,
|
|
67
|
+
undefined,
|
|
68
|
+
undefined,
|
|
69
|
+
undefined,
|
|
70
|
+
new RegExp("\\.(js|jsx|cjs|mjs|ts|tsx|vue|svelte)$")
|
|
71
|
+
)
|
|
72
|
+
]);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Convert a single JS/TS file to AST
|
|
76
|
+
*/
|
|
77
|
+
const fileToJsAst = (file) => {
|
|
78
|
+
if (file.endsWith(".vue") || file.endsWith(".svelte")) {
|
|
79
|
+
return toVueAst(file);
|
|
80
|
+
}
|
|
81
|
+
return codeToJsAst(readFileSync(file, "utf-8"));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Convert a single JS/TS code snippet to AST
|
|
86
|
+
*/
|
|
87
|
+
const codeToJsAst = (code) => {
|
|
88
|
+
try {
|
|
89
|
+
return parse(code, babelParserOptions);
|
|
90
|
+
} catch {
|
|
91
|
+
return parse(code, babelSafeParserOptions);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const vueCleaningRegex = /<\/*script.*>|<style[\s\S]*style>|<\/*br>/gi;
|
|
96
|
+
const vueTemplateRegex = /(<template.*>)([\s\S]*)(<\/template>)/gi;
|
|
97
|
+
const vueCommentRegex = /<!--[\s\S]*?-->/gi;
|
|
98
|
+
const vueBindRegex = /(:\[)([\s\S]*?)(\])/gi;
|
|
99
|
+
const vuePropRegex = /\s([.:@])([a-zA-Z]*?=)/gi;
|
|
100
|
+
const vueOpenImgTag = /(<img)((?!>)[\s\S]+?)( [^/]>)/gi;
|
|
101
|
+
|
|
102
|
+
const TSC_FLAGS =
|
|
103
|
+
tsc.TypeFormatFlags.NoTruncation |
|
|
104
|
+
tsc.TypeFormatFlags.InTypeAlias |
|
|
105
|
+
tsc.TypeFormatFlags.WriteArrayAsGenericType |
|
|
106
|
+
tsc.TypeFormatFlags.GenerateNamesForShadowedTypeParams |
|
|
107
|
+
tsc.TypeFormatFlags.WriteTypeArgumentsOfSignature |
|
|
108
|
+
tsc.TypeFormatFlags.UseFullyQualifiedType |
|
|
109
|
+
tsc.TypeFormatFlags.NoTypeReduction;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Convert a single vue file to AST
|
|
113
|
+
*/
|
|
114
|
+
const toVueAst = (file) => {
|
|
115
|
+
const code = readFileSync(file, "utf-8");
|
|
116
|
+
const cleanedCode = code
|
|
117
|
+
.replace(vueCommentRegex, function (match) {
|
|
118
|
+
return match.replaceAll(/\S/g, " ");
|
|
119
|
+
})
|
|
120
|
+
.replace(vueCleaningRegex, function (match) {
|
|
121
|
+
return match.replaceAll(/\S/g, " ").substring(1) + ";";
|
|
122
|
+
})
|
|
123
|
+
.replace(vueBindRegex, function (match, grA, grB, grC) {
|
|
124
|
+
return grA.replaceAll(/\S/g, " ") + grB + grC.replaceAll(/\S/g, " ");
|
|
125
|
+
})
|
|
126
|
+
.replace(vuePropRegex, function (match, grA, grB) {
|
|
127
|
+
return " " + grA.replace(/[.:@]/g, " ") + grB.replaceAll(".", "-");
|
|
128
|
+
})
|
|
129
|
+
.replace(vueOpenImgTag, function (match, grA, grB, grC) {
|
|
130
|
+
return grA + grB + grC.replace(" >", "/>");
|
|
131
|
+
})
|
|
132
|
+
.replace(vueTemplateRegex, function (match, grA, grB, grC) {
|
|
133
|
+
return grA + grB.replaceAll("{{", "{ ").replaceAll("}}", " }") + grC;
|
|
134
|
+
});
|
|
135
|
+
return codeToJsAst(cleanedCode);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
function createTsc(srcFiles) {
|
|
139
|
+
try {
|
|
140
|
+
const program = tsc.createProgram(srcFiles, {
|
|
141
|
+
target: tsc.ScriptTarget.ES2020,
|
|
142
|
+
module: tsc.ModuleKind.CommonJS,
|
|
143
|
+
allowImportingTsExtensions: false,
|
|
144
|
+
allowArbitraryExtensions: false,
|
|
145
|
+
allowSyntheticDefaultImports: true,
|
|
146
|
+
allowUmdGlobalAccess: true,
|
|
147
|
+
allowJs: true,
|
|
148
|
+
allowUnreachableCode: true,
|
|
149
|
+
allowUnusedLabels: true,
|
|
150
|
+
alwaysStrict: false,
|
|
151
|
+
emitDecoratorMetadata: true,
|
|
152
|
+
exactOptionalPropertyTypes: true,
|
|
153
|
+
experimentalDecorators: false,
|
|
154
|
+
ignoreDeprecations: true,
|
|
155
|
+
noStrictGenericChecks: true,
|
|
156
|
+
noUncheckedIndexedAccess: false,
|
|
157
|
+
noPropertyAccessFromIndexSignature: false,
|
|
158
|
+
removeComments: true
|
|
159
|
+
});
|
|
160
|
+
const typeChecker = program.getTypeChecker();
|
|
161
|
+
const seenTypes = new Map();
|
|
162
|
+
|
|
163
|
+
const safeTypeToString = (node) => {
|
|
164
|
+
try {
|
|
165
|
+
return typeChecker.typeToString(node, TSC_FLAGS);
|
|
166
|
+
} catch (err) {
|
|
167
|
+
return "any";
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const safeTypeWithContextToString = (node, context) => {
|
|
172
|
+
try {
|
|
173
|
+
return typeChecker.typeToString(node, context, TSC_FLAGS);
|
|
174
|
+
} catch (err) {
|
|
175
|
+
return "any";
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const addType = (node) => {
|
|
180
|
+
let typeStr;
|
|
181
|
+
if (
|
|
182
|
+
tsc.isSetAccessor(node) ||
|
|
183
|
+
tsc.isGetAccessor(node) ||
|
|
184
|
+
tsc.isGetAccessorDeclaration(node) ||
|
|
185
|
+
tsc.isCallSignatureDeclaration(node) ||
|
|
186
|
+
tsc.isIndexSignatureDeclaration(node) ||
|
|
187
|
+
tsc.isClassStaticBlockDeclaration(node) ||
|
|
188
|
+
tsc.isConstructSignatureDeclaration(node) ||
|
|
189
|
+
tsc.isMethodDeclaration(node) ||
|
|
190
|
+
tsc.isFunctionDeclaration(node) ||
|
|
191
|
+
tsc.isConstructorDeclaration(node) ||
|
|
192
|
+
tsc.isTypeAliasDeclaration(node) ||
|
|
193
|
+
tsc.isEnumDeclaration(node) ||
|
|
194
|
+
tsc.isNamespaceExportDeclaration(node) ||
|
|
195
|
+
tsc.isImportEqualsDeclaration(node)
|
|
196
|
+
) {
|
|
197
|
+
const signature = typeChecker.getSignatureFromDeclaration(node);
|
|
198
|
+
const returnType = typeChecker.getReturnTypeOfSignature(signature);
|
|
199
|
+
typeStr = safeTypeToString(returnType);
|
|
200
|
+
} else if (tsc.isFunctionLike(node)) {
|
|
201
|
+
const funcType = typeChecker.getTypeAtLocation(node);
|
|
202
|
+
const funcSignature = typeChecker.getSignaturesOfType(
|
|
203
|
+
funcType,
|
|
204
|
+
tsc.SignatureKind.Call
|
|
205
|
+
)[0];
|
|
206
|
+
if (funcSignature) {
|
|
207
|
+
typeStr = safeTypeToString(funcSignature.getReturnType());
|
|
208
|
+
} else {
|
|
209
|
+
typeStr = safeTypeWithContextToString(
|
|
210
|
+
typeChecker.getTypeAtLocation(node),
|
|
211
|
+
node
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
} else {
|
|
215
|
+
typeStr = safeTypeWithContextToString(
|
|
216
|
+
typeChecker.getTypeAtLocation(node),
|
|
217
|
+
node
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
if (!["any", "unknown", "any[]", "unknown[]"].includes(typeStr)) {
|
|
221
|
+
seenTypes.set(node.getStart(), typeStr);
|
|
222
|
+
}
|
|
223
|
+
tsc.forEachChild(node, addType);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
return {
|
|
227
|
+
program: program,
|
|
228
|
+
typeChecker: typeChecker,
|
|
229
|
+
addType: addType,
|
|
230
|
+
seenTypes: seenTypes
|
|
231
|
+
};
|
|
232
|
+
} catch (err) {
|
|
233
|
+
console.warn("Retrieving types", err.message);
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Generate AST for JavaScript or TypeScript
|
|
240
|
+
*/
|
|
241
|
+
const createJSAst = async (options) => {
|
|
242
|
+
try {
|
|
243
|
+
const promiseMap = await getAllSrcJSAndTSFiles(options.src);
|
|
244
|
+
const srcFiles = promiseMap.flatMap((d) => d);
|
|
245
|
+
let ts;
|
|
246
|
+
if (options.tsTypes) {
|
|
247
|
+
ts = createTsc(srcFiles);
|
|
248
|
+
}
|
|
249
|
+
for (const file of srcFiles) {
|
|
250
|
+
try {
|
|
251
|
+
const ast = fileToJsAst(file);
|
|
252
|
+
writeAstFile(file, ast, options);
|
|
253
|
+
} catch (err) {
|
|
254
|
+
console.error(file, err.message);
|
|
255
|
+
}
|
|
256
|
+
if (ts) {
|
|
257
|
+
try {
|
|
258
|
+
const tsAst = ts.program.getSourceFile(file);
|
|
259
|
+
tsc.forEachChild(tsAst, ts.addType);
|
|
260
|
+
writeTypesFile(file, ts.seenTypes, options);
|
|
261
|
+
ts.seenTypes.clear();
|
|
262
|
+
} catch (err) {
|
|
263
|
+
console.warn("Retrieving types", file, ":", err.message);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
} catch (err) {
|
|
268
|
+
console.error(err);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Generate AST for .vue files
|
|
274
|
+
*/
|
|
275
|
+
const createVueAst = async (options) => {
|
|
276
|
+
const srcFiles = await getAllFiles(options.src, ".vue");
|
|
277
|
+
for (const file of srcFiles) {
|
|
278
|
+
try {
|
|
279
|
+
const ast = toVueAst(file);
|
|
280
|
+
if (ast) {
|
|
281
|
+
writeAstFile(file, ast, options);
|
|
282
|
+
}
|
|
283
|
+
} catch (err) {
|
|
284
|
+
console.error(file, err.message);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Deal with cyclic reference in json
|
|
291
|
+
*/
|
|
292
|
+
const getCircularReplacer = () => {
|
|
293
|
+
const seen = new WeakSet();
|
|
294
|
+
return (key, value) => {
|
|
295
|
+
if (typeof value === "object" && value !== null) {
|
|
296
|
+
if (seen.has(value)) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
seen.add(value);
|
|
300
|
+
}
|
|
301
|
+
return value;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Write AST data to a json file
|
|
307
|
+
*/
|
|
308
|
+
const writeAstFile = (file, ast, options) => {
|
|
309
|
+
const relativePath = file.replace(new RegExp("^" + options.src + "/"), "");
|
|
310
|
+
const outAstFile = join(options.output, relativePath + ".json");
|
|
311
|
+
const data = {
|
|
312
|
+
fullName: file,
|
|
313
|
+
relativeName: relativePath,
|
|
314
|
+
ast: ast
|
|
315
|
+
};
|
|
316
|
+
mkdirSync(dirname(outAstFile), { recursive: true });
|
|
317
|
+
writeFileSync(outAstFile, JSON.stringify(data, getCircularReplacer(), " "));
|
|
318
|
+
console.log("Converted AST for", relativePath, "to", outAstFile);
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
const writeTypesFile = (file, seenTypes, options) => {
|
|
322
|
+
const relativePath = file.replace(new RegExp("^" + options.src + "/"), "");
|
|
323
|
+
const outTypeFile = join(options.output, relativePath + ".typemap");
|
|
324
|
+
mkdirSync(dirname(outTypeFile), { recursive: true });
|
|
325
|
+
writeFileSync(
|
|
326
|
+
outTypeFile,
|
|
327
|
+
JSON.stringify(Object.fromEntries(seenTypes), undefined, " ")
|
|
328
|
+
);
|
|
329
|
+
console.log("Converted types for", relativePath, "to", outTypeFile);
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
const createXAst = async (options) => {
|
|
333
|
+
const src_dir = options.src;
|
|
334
|
+
try {
|
|
335
|
+
accessSync(src_dir, constants.R_OK);
|
|
336
|
+
} catch (err) {
|
|
337
|
+
console.error(src_dir, "is invalid");
|
|
338
|
+
process.exit(1);
|
|
339
|
+
}
|
|
340
|
+
if (
|
|
341
|
+
existsSync(join(src_dir, "package.json")) ||
|
|
342
|
+
existsSync(join(src_dir, "rush.json"))
|
|
343
|
+
) {
|
|
344
|
+
return await createJSAst(options);
|
|
345
|
+
}
|
|
346
|
+
console.error(src_dir, "unknown project type");
|
|
347
|
+
process.exit(1);
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Method to start the ast generation process
|
|
352
|
+
*
|
|
353
|
+
* @args options CLI arguments
|
|
354
|
+
*/
|
|
355
|
+
const start = async (options) => {
|
|
356
|
+
let { type } = options;
|
|
357
|
+
if (!type) {
|
|
358
|
+
type = "";
|
|
359
|
+
}
|
|
360
|
+
type = type.toLowerCase();
|
|
361
|
+
switch (type) {
|
|
362
|
+
case "nodejs":
|
|
363
|
+
case "js":
|
|
364
|
+
case "javascript":
|
|
365
|
+
case "typescript":
|
|
366
|
+
case "ts":
|
|
367
|
+
return await createJSAst(options);
|
|
368
|
+
case "vue":
|
|
369
|
+
return await createVueAst(options);
|
|
370
|
+
default:
|
|
371
|
+
return await createXAst(options);
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
async function main(argvs) {
|
|
376
|
+
const args = yargs(hideBin(argvs))
|
|
377
|
+
.option("src", {
|
|
378
|
+
alias: "i",
|
|
379
|
+
default: ".",
|
|
380
|
+
description: "Source directory"
|
|
381
|
+
})
|
|
382
|
+
.option("output", {
|
|
383
|
+
alias: "o",
|
|
384
|
+
default: "ast_out",
|
|
385
|
+
description: "Output directory for generated AST json files"
|
|
386
|
+
})
|
|
387
|
+
.option("type", {
|
|
388
|
+
alias: "t",
|
|
389
|
+
description: "Project type. Default auto-detect"
|
|
390
|
+
})
|
|
391
|
+
.option("recurse", {
|
|
392
|
+
alias: "r",
|
|
393
|
+
default: true,
|
|
394
|
+
type: "boolean",
|
|
395
|
+
description: "Recurse mode suitable for mono-repos"
|
|
396
|
+
})
|
|
397
|
+
.option("tsTypes", {
|
|
398
|
+
default: true,
|
|
399
|
+
type: "boolean",
|
|
400
|
+
description: "Generate type mappings using the Typescript Compiler API"
|
|
401
|
+
})
|
|
402
|
+
.version(ASTGEN_VERSION)
|
|
403
|
+
.help("h").argv;
|
|
404
|
+
|
|
405
|
+
if (args.version) {
|
|
406
|
+
console.log(ASTGEN_VERSION);
|
|
407
|
+
process.exit(0);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
try {
|
|
411
|
+
if (args.output === "ast_out") {
|
|
412
|
+
args.output = join(args.src, args.output);
|
|
413
|
+
}
|
|
414
|
+
await start(args);
|
|
415
|
+
} catch (e) {
|
|
416
|
+
console.error(e);
|
|
417
|
+
process.exit(1);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
main(process.argv);
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log("atom-parsetools installed successfully.");
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@appthreat/atom-parsetools",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Parsing tools that complement the @appthreat/atom project.",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"pretty": "prettier --write *.mjs *.js --trailing-comma=none",
|
|
9
|
+
"lint": "eslint *.mjs *.js"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@appthreat/atom-common": "^1.0.0",
|
|
13
|
+
"@babel/parser": "^7.27.1",
|
|
14
|
+
"typescript": "^5.8.3",
|
|
15
|
+
"yargs": "^17.7.2"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"eslint": "8.57.0"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"astgen": "astgen.js",
|
|
22
|
+
"phpastgen": "phpastgen.js",
|
|
23
|
+
"rbastgen": "rbastgen.js",
|
|
24
|
+
"scalasem": "scalasem.js"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=16.0.0"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/AppThreat/atom.git"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"atom",
|
|
35
|
+
"commands",
|
|
36
|
+
"parse",
|
|
37
|
+
"astgen",
|
|
38
|
+
"code",
|
|
39
|
+
"analysis"
|
|
40
|
+
],
|
|
41
|
+
"author": "Team AppThreat <cloud@appthreat.com>",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/AppThreat/atom/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/AppThreat/atom#readme",
|
|
47
|
+
"files": [
|
|
48
|
+
"*.js",
|
|
49
|
+
"plugins/",
|
|
50
|
+
"LICENSE"
|
|
51
|
+
],
|
|
52
|
+
"packageManager": "npm"
|
|
53
|
+
}
|
package/phpastgen.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { detectPhp } from "@appthreat/atom-common";
|
|
7
|
+
|
|
8
|
+
let url = import.meta.url;
|
|
9
|
+
if (!url.startsWith("file://")) {
|
|
10
|
+
url = new URL(`file://${import.meta.url}`).toString();
|
|
11
|
+
}
|
|
12
|
+
const dirName = import.meta ? dirname(fileURLToPath(url)) : __dirname;
|
|
13
|
+
export const PLUGINS_HOME = join(dirName, "plugins");
|
|
14
|
+
const PHP_PARSER_BIN =
|
|
15
|
+
process.env.PHP_PARSER_BIN || join(PLUGINS_HOME, "bin", "php-parse");
|
|
16
|
+
|
|
17
|
+
function main(argvs) {
|
|
18
|
+
if (!detectPhp()) {
|
|
19
|
+
console.warn("PHP is not installed!");
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
const cwd = process.env.ATOM_CWD || process.cwd();
|
|
23
|
+
argvs.splice(0, 1, PHP_PARSER_BIN);
|
|
24
|
+
spawnSync(process.env.PHP_CMD || "php", argvs, {
|
|
25
|
+
encoding: "utf-8",
|
|
26
|
+
cwd,
|
|
27
|
+
stdio: "inherit",
|
|
28
|
+
stderr: "inherit",
|
|
29
|
+
env: process.env,
|
|
30
|
+
timeout: process.env.ATOM_TIMEOUT || process.env.ASTGEN_TIMEOUT
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
main(process.argv.slice(2));
|
package/plugins/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
// autoload.php @generated by Composer
|
|
4
|
+
|
|
5
|
+
if (PHP_VERSION_ID < 50600) {
|
|
6
|
+
if (!headers_sent()) {
|
|
7
|
+
header('HTTP/1.1 500 Internal Server Error');
|
|
8
|
+
}
|
|
9
|
+
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
|
10
|
+
if (!ini_get('display_errors')) {
|
|
11
|
+
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
|
12
|
+
fwrite(STDERR, $err);
|
|
13
|
+
} elseif (!headers_sent()) {
|
|
14
|
+
echo $err;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
throw new RuntimeException($err);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
require_once __DIR__ . '/composer/autoload_real.php';
|
|
21
|
+
|
|
22
|
+
return ComposerAutoloaderInitf8ec96d581b5c88a936d13783175ff17::getLoader();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'bundler' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
$:.unshift File.expand_path "../rubyastgen/bundle", __dir__
|
|
12
|
+
|
|
13
|
+
require "bundler/setup"
|
|
14
|
+
load File.expand_path "../../../../../../../../../../../opt/hostedtoolcache/Ruby/3.4.3/x64/lib/ruby/gems/3.4.0/gems/bundler-2.6.7/exe/bundler", __dir__
|