@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,232 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NodeHandling
|
|
4
|
+
|
|
5
|
+
MAX_NESTING_DEPTH = 100
|
|
6
|
+
|
|
7
|
+
SINGLETONS = [:nil, :true, :false] #:__FILE__, :__LINE__, :__ENCODING__
|
|
8
|
+
LITERALS = [:int, :float, :rational, :complex, :str, :sym]
|
|
9
|
+
CALLS = [:send, :csend]
|
|
10
|
+
DYNAMIC_LITERALS = [:dsym, :dstr]
|
|
11
|
+
CONTROL_KW = [:break, :next]
|
|
12
|
+
ARGUMENTS = [:arg, :restarg, :blockarg, :kwrestarg, :shadowarg]
|
|
13
|
+
KW_ARGUMENTS = [:kwarg, :kwnilarg, :kwoptarg]
|
|
14
|
+
REFS = [:nth_ref, :back_ref]
|
|
15
|
+
FORWARD_ARGUMENTS = [:forward_args, :forwarded_args, :forward_arg]
|
|
16
|
+
ASSIGNMENTS = [:or_asgn, :and_asgn, :lvasgn, :ivasgn, :gvasgn, :cvasgn, :match_with_lvasgn]
|
|
17
|
+
BIN_OP = [:and, :or, :match_pattern, :match_pattern_p]
|
|
18
|
+
ACCESS = [:self, :ident, :lvar, :cvar, :gvar, :ivar, :splat, :kwsplat, :block_pass, :match_var]
|
|
19
|
+
QUAL_ACCESS = [:casgn]
|
|
20
|
+
COLLECTIONS = [:args, :array, :hash, :mlhs, :hash_pattern, :array_pattern, :array_pattern_with_tail, :find_pattern, :undef, :procarg0]
|
|
21
|
+
SPECIAL_CMD = [:yield, :super, :defined?, :xstr]
|
|
22
|
+
RANGE_OP = [:erange, :irange, :eflipflop, :iflipflop]
|
|
23
|
+
|
|
24
|
+
def self.fetch_member(loc, method)
|
|
25
|
+
loc.public_send(method) rescue -1
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.ast_to_json(node, code, current_depth: 0, file_path: nil)
|
|
29
|
+
return unless node.is_a?(Parser::AST::Node)
|
|
30
|
+
|
|
31
|
+
loc = node.location
|
|
32
|
+
meta_data = {
|
|
33
|
+
start_line: fetch_member(loc, :line),
|
|
34
|
+
start_column: fetch_member(loc, :column),
|
|
35
|
+
end_line: fetch_member(loc, :last_line),
|
|
36
|
+
end_column: fetch_member(loc, :last_column),
|
|
37
|
+
offset_start: loc&.expression&.begin_pos,
|
|
38
|
+
offset_end: loc&.expression&.end_pos,
|
|
39
|
+
code: self.extract_code_snippet(loc, code)
|
|
40
|
+
}
|
|
41
|
+
if current_depth >= MAX_NESTING_DEPTH
|
|
42
|
+
RubyAstGen::Logger::warn "Reached max JSON depth on a #{node.type.to_s} node"
|
|
43
|
+
return { type: node.type.to_s, meta_data: meta_data, nested: true }
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
base_hash = {
|
|
47
|
+
type: node.type.to_s, # Node type (e.g., :send, :def, etc.)
|
|
48
|
+
meta_data: meta_data,
|
|
49
|
+
children: node.children.map do |child|
|
|
50
|
+
if child.is_a?(Parser::AST::Node)
|
|
51
|
+
ast_to_json(child, code, current_depth: current_depth + 1, file_path: file_path) # Recursively process child nodes
|
|
52
|
+
else
|
|
53
|
+
child # If it's not a node (e.g., literal), return as-is
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
}
|
|
57
|
+
add_node_properties(node.type, base_hash, file_path)
|
|
58
|
+
return base_hash
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def self.trim_string(string)
|
|
62
|
+
string.gsub(/\n/, " ").gsub(/(\s)+/, " ")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def self.extract_code_snippet(location, source_code)
|
|
66
|
+
return nil unless location
|
|
67
|
+
range = location.expression || location
|
|
68
|
+
return nil unless range.is_a?(Parser::Source::Range)
|
|
69
|
+
snippet = source_code[range.begin_pos...range.end_pos]
|
|
70
|
+
self.trim_string(snippet.strip)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def self.add_node_properties(node_type, base_map, file_path)
|
|
74
|
+
children = base_map.delete(:children)
|
|
75
|
+
|
|
76
|
+
case node_type
|
|
77
|
+
when :def
|
|
78
|
+
base_map[:name] = children[0]
|
|
79
|
+
base_map[:arguments] = children[1]
|
|
80
|
+
base_map[:body] = children[2]
|
|
81
|
+
when :defs
|
|
82
|
+
base_map[:base] = children[0]
|
|
83
|
+
base_map[:name] = children[1]
|
|
84
|
+
base_map[:arguments] = children[2]
|
|
85
|
+
base_map[:body] = children[3]
|
|
86
|
+
|
|
87
|
+
when :class
|
|
88
|
+
base_map[:name] = children[0]
|
|
89
|
+
base_map[:superclass] = children[1] if children[1]
|
|
90
|
+
base_map[:body] = children[2]
|
|
91
|
+
when :sclass
|
|
92
|
+
base_map[:name] = children[0]
|
|
93
|
+
base_map[:def] = children[1]
|
|
94
|
+
base_map[:body] = children[2]
|
|
95
|
+
when :module
|
|
96
|
+
base_map[:name] = children[0]
|
|
97
|
+
base_map[:body] = children[1]
|
|
98
|
+
|
|
99
|
+
when :if
|
|
100
|
+
base_map[:condition] = children[0]
|
|
101
|
+
base_map[:then_branch] = children[1]
|
|
102
|
+
base_map[:else_branch] = children[2] if children[2]
|
|
103
|
+
when :while, :while_post
|
|
104
|
+
base_map[:condition] = children[0]
|
|
105
|
+
base_map[:body] = children[1]
|
|
106
|
+
when :for, :for_post
|
|
107
|
+
base_map[:variable] = children[0]
|
|
108
|
+
base_map[:collection] = children[1]
|
|
109
|
+
base_map[:body] = children[2]
|
|
110
|
+
when :block
|
|
111
|
+
base_map[:call_name] = children[0]
|
|
112
|
+
base_map[:arguments] = children[1]
|
|
113
|
+
base_map[:body] = children[2]
|
|
114
|
+
when :begin
|
|
115
|
+
base_map[:body] = children
|
|
116
|
+
when :kwbegin
|
|
117
|
+
base_map[:body] = children[0..-1]
|
|
118
|
+
when :case
|
|
119
|
+
base_map[:case_expression] = children[0]
|
|
120
|
+
base_map[:when_clauses] = children[1..-2]
|
|
121
|
+
base_map[:else_clause] = children[-1] if children[-1]
|
|
122
|
+
when :when
|
|
123
|
+
base_map[:conditions] = children[0..-2]
|
|
124
|
+
base_map[:then_branch] = children[-1]
|
|
125
|
+
when :unless
|
|
126
|
+
base_map[:condition] = children[0]
|
|
127
|
+
base_map[:then_branch] = children[1]
|
|
128
|
+
when :until, :until_post
|
|
129
|
+
base_map[:condition] = children[0]
|
|
130
|
+
base_map[:body] = children[1]
|
|
131
|
+
when :rescue, :case_match
|
|
132
|
+
base_map[:statement] = children[0]
|
|
133
|
+
base_map[:bodies] = children[1..-2]
|
|
134
|
+
base_map[:else_clause] = children[-1] if children[-1]
|
|
135
|
+
when :match_as
|
|
136
|
+
base_map[:value] = children[0]
|
|
137
|
+
base_map[:as] = children[1]
|
|
138
|
+
when :in_pattern
|
|
139
|
+
base_map[:pattern] = children[0]
|
|
140
|
+
base_map[:guard] = children[1]
|
|
141
|
+
base_map[:body] = children[2]
|
|
142
|
+
when :if_guard, :unless_guard
|
|
143
|
+
base_map[:condition] = children[0]
|
|
144
|
+
when :match_alt
|
|
145
|
+
base_map[:left] = children[0]
|
|
146
|
+
base_map[:right] = children[1]
|
|
147
|
+
when :resbody
|
|
148
|
+
base_map[:exec_list] = children[0]
|
|
149
|
+
base_map[:exec_var] = children[1]
|
|
150
|
+
base_map[:body] = children[2]
|
|
151
|
+
when :ensure
|
|
152
|
+
base_map[:statement] = children[0]
|
|
153
|
+
base_map[:body] = children[1]
|
|
154
|
+
when :regopt, *REFS, :redo
|
|
155
|
+
base_map[:value] = children[0] if children[0]
|
|
156
|
+
when :return
|
|
157
|
+
base_map[:values] = children[0..-1] if children[0]
|
|
158
|
+
when *CONTROL_KW
|
|
159
|
+
base_map[:arguments] = children[0] if children[0]
|
|
160
|
+
when *FORWARD_ARGUMENTS, :retry, :zsuper, :match_nil_pattern
|
|
161
|
+
# refer to :type
|
|
162
|
+
when *QUAL_ACCESS
|
|
163
|
+
base_map[:base] = children[0]
|
|
164
|
+
base_map[:lhs] = children[1]
|
|
165
|
+
base_map[:rhs] = children[2]
|
|
166
|
+
when :op_asgn
|
|
167
|
+
base_map[:lhs] = children[0]
|
|
168
|
+
base_map[:op] = children[1]
|
|
169
|
+
base_map[:rhs] = children[2]
|
|
170
|
+
when *ASSIGNMENTS
|
|
171
|
+
base_map[:lhs] = children[0]
|
|
172
|
+
base_map[:rhs] = children[1] if children[1]
|
|
173
|
+
when *BIN_OP
|
|
174
|
+
base_map[:lhs] = children[0]
|
|
175
|
+
base_map[:rhs] = children[1]
|
|
176
|
+
when *SINGLETONS
|
|
177
|
+
base_map[:value] = node_type
|
|
178
|
+
when *KW_ARGUMENTS
|
|
179
|
+
base_map[:key] = children[0]
|
|
180
|
+
base_map[:value] = children[1]
|
|
181
|
+
when *LITERALS, *ARGUMENTS, *ACCESS, :match_rest
|
|
182
|
+
base_map[:value] = children[0]
|
|
183
|
+
when :cbase
|
|
184
|
+
base_map[:base] = children[0]
|
|
185
|
+
base_map[:name] = children[1]
|
|
186
|
+
|
|
187
|
+
when *CALLS
|
|
188
|
+
base_map[:receiver] = children[0]
|
|
189
|
+
base_map[:name] = children[1]
|
|
190
|
+
base_map[:arguments] = children[2..-1] # Variable arguments
|
|
191
|
+
when *SPECIAL_CMD
|
|
192
|
+
base_map[:arguments] = children
|
|
193
|
+
|
|
194
|
+
when :pair, :optarg
|
|
195
|
+
base_map[:key] = children[0]
|
|
196
|
+
base_map[:value] = children[1]
|
|
197
|
+
when :const
|
|
198
|
+
base_map[:base] = children[0]
|
|
199
|
+
base_map[:name] = children[1]
|
|
200
|
+
when :alias
|
|
201
|
+
base_map[:alias] = children[0]
|
|
202
|
+
base_map[:name] = children[1]
|
|
203
|
+
when :regexp
|
|
204
|
+
base_map[:value] = children[0]
|
|
205
|
+
base_map[:opt] = children[1]
|
|
206
|
+
when *RANGE_OP
|
|
207
|
+
base_map[:start] = children[0]
|
|
208
|
+
base_map[:end] = children[1]
|
|
209
|
+
|
|
210
|
+
when :numblock
|
|
211
|
+
base_map[:call] = children[0]
|
|
212
|
+
base_map[:param_idx] = children[1]
|
|
213
|
+
base_map[:body] = children[2]
|
|
214
|
+
|
|
215
|
+
when :masgn
|
|
216
|
+
base_map[:lhs] = children[0]
|
|
217
|
+
base_map[:rhs] = children[1]
|
|
218
|
+
|
|
219
|
+
when :preexe, :postexe
|
|
220
|
+
base_map[:body] = children[0]
|
|
221
|
+
|
|
222
|
+
when *COLLECTIONS, *DYNAMIC_LITERALS, *REFS
|
|
223
|
+
# put :children back
|
|
224
|
+
base_map[:children] = children
|
|
225
|
+
|
|
226
|
+
else
|
|
227
|
+
RubyAstGen::Logger::warn "Unhandled AST node type: #{node_type} - #{file_path}"
|
|
228
|
+
base_map[:children] = children
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
end
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
$VERBOSE = nil
|
|
2
|
+
require 'parser/current'
|
|
3
|
+
$VERBOSE = true
|
|
4
|
+
require 'fileutils'
|
|
5
|
+
require 'json'
|
|
6
|
+
require 'thread'
|
|
7
|
+
|
|
8
|
+
require_relative 'ruby_ast_gen/version'
|
|
9
|
+
require_relative 'ruby_ast_gen/node_handling'
|
|
10
|
+
|
|
11
|
+
module RubyAstGen
|
|
12
|
+
|
|
13
|
+
module Logger
|
|
14
|
+
|
|
15
|
+
def self.debug(message)
|
|
16
|
+
puts "[DEBUG] #{message}"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.info(message)
|
|
20
|
+
puts "[INFO] #{message}"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.warn(message)
|
|
24
|
+
puts "[WARN] #{message}"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.error(message)
|
|
28
|
+
puts "[ERR] #{message}"
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Main method to parse the input and generate the AST output
|
|
33
|
+
def self.parse(opts)
|
|
34
|
+
if opts[:debug]
|
|
35
|
+
RubyAstGen::Logger::debug "CLI Arguments received: #{opts}"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
input_path = opts[:input]
|
|
39
|
+
output_dir = opts[:output]
|
|
40
|
+
exclude_regex = Regexp.new(opts[:exclude])
|
|
41
|
+
|
|
42
|
+
if opts[:debug]
|
|
43
|
+
RubyAstGen::Logger::debug "Exclude Regex Received: #{exclude_regex}"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
FileUtils.mkdir_p(output_dir)
|
|
47
|
+
|
|
48
|
+
if File.file?(input_path)
|
|
49
|
+
process_file(input_path, output_dir, exclude_regex, input_path)
|
|
50
|
+
elsif File.directory?(input_path)
|
|
51
|
+
process_directory(input_path, output_dir, exclude_regex)
|
|
52
|
+
else
|
|
53
|
+
RubyAstGen::Logger::info "#{input_path} is neither a file nor a directory."
|
|
54
|
+
exit 1
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
private
|
|
59
|
+
|
|
60
|
+
# Process a single file and generate its AST
|
|
61
|
+
def self.process_file(file_path, output_dir, exclude_regex, base_dir)
|
|
62
|
+
# Get the relative path of the file to apply exclusion rules
|
|
63
|
+
relative_path = file_path.sub(%r{^.*\/}, '')
|
|
64
|
+
relative_input_path = file_path.sub("#{base_dir}/", '')
|
|
65
|
+
# Skip if the file matches the exclusion regex
|
|
66
|
+
if exclude_regex && exclude_regex.match?(relative_input_path)
|
|
67
|
+
RubyAstGen::Logger::debug "Excluding: #{relative_input_path}"
|
|
68
|
+
return
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
return unless ruby_file?(file_path) # Skip if it's not a Ruby-related file
|
|
72
|
+
|
|
73
|
+
begin
|
|
74
|
+
ast = parse_file(file_path, relative_input_path)
|
|
75
|
+
return unless ast
|
|
76
|
+
|
|
77
|
+
output_path = File.join(output_dir, "#{relative_path}.json")
|
|
78
|
+
|
|
79
|
+
File.write(output_path, JSON.generate(ast))
|
|
80
|
+
rescue StandardError => e
|
|
81
|
+
RubyAstGen::Logger::info "'#{relative_input_path}' - #{e.message}"
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def self.process_directory(dir_path, output_dir, exclude_regex, max_threads = 10)
|
|
86
|
+
threads = []
|
|
87
|
+
queue = Queue.new
|
|
88
|
+
|
|
89
|
+
Dir.glob("#{dir_path}/**/*").each do |path|
|
|
90
|
+
next unless File.file?(path) && ruby_file?(path)
|
|
91
|
+
relative_dir = path.sub("#{dir_path}/", '')
|
|
92
|
+
next if exclude_regex.match?(relative_dir)
|
|
93
|
+
|
|
94
|
+
queue << path
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
max_threads.times do
|
|
98
|
+
threads << Thread.new do
|
|
99
|
+
until queue.empty?
|
|
100
|
+
begin
|
|
101
|
+
path = queue.pop(true) rescue nil # Non-blocking pop
|
|
102
|
+
next unless path
|
|
103
|
+
|
|
104
|
+
relative_path = path.sub(dir_path, '')
|
|
105
|
+
output_subdir = File.join(output_dir, File.dirname(relative_path))
|
|
106
|
+
FileUtils.mkdir_p(output_subdir)
|
|
107
|
+
|
|
108
|
+
process_file(path, output_subdir, exclude_regex, dir_path)
|
|
109
|
+
rescue => e
|
|
110
|
+
RubyAstGen::Logger::info "Error processing #{path}: #{e.message}"
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
threads.each(&:join)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def self.parse_file(file_path, relative_input_path)
|
|
120
|
+
code = File.read(file_path)
|
|
121
|
+
buffer = Parser::Source::Buffer.new(file_path)
|
|
122
|
+
buffer.source = code
|
|
123
|
+
parser = Parser::CurrentRuby.new
|
|
124
|
+
ast = parser.parse(buffer)
|
|
125
|
+
return unless ast
|
|
126
|
+
json_ast = NodeHandling::ast_to_json(ast, code, file_path: relative_input_path)
|
|
127
|
+
json_ast[:file_path] = file_path
|
|
128
|
+
json_ast[:rel_file_path] = relative_input_path
|
|
129
|
+
json_ast
|
|
130
|
+
rescue Parser::SyntaxError => e
|
|
131
|
+
RubyAstGen::Logger::info "Failed to parse #{file_path}: #{e.message}"
|
|
132
|
+
nil
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def self.ruby_file?(file_path)
|
|
136
|
+
ext = File.extname(file_path)
|
|
137
|
+
%w[.rb .gemspec Rakefile .rake .ru].include?(ext) || file_path.end_with?('.rb')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
# stub: ruby_ast_gen 1.0.4 ruby lib
|
|
3
|
+
|
|
4
|
+
Gem::Specification.new do |s|
|
|
5
|
+
s.name = "ruby_ast_gen".freeze
|
|
6
|
+
s.version = "1.0.4".freeze
|
|
7
|
+
|
|
8
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
9
|
+
s.metadata = { "homepage_uri" => "https://github.com/appthreat/ruby_ast_gen" } if s.respond_to? :metadata=
|
|
10
|
+
s.require_paths = ["lib".freeze]
|
|
11
|
+
s.authors = ["David Baker Effendi".freeze, "Andrei Dreyer".freeze, "Team AppThreat".freeze]
|
|
12
|
+
s.bindir = "exe".freeze
|
|
13
|
+
s.date = "1980-01-02"
|
|
14
|
+
s.description = "A Ruby parser than dumps the AST as JSON output for atom `rubysrc2cpg` frontend".freeze
|
|
15
|
+
s.email = ["dave@whirlylabs.com".freeze, "andrei@whirlylabs.com".freeze, "hello@appthreat.com".freeze]
|
|
16
|
+
s.executables = ["ruby_ast_gen".freeze]
|
|
17
|
+
s.files = ["Gemfile".freeze, "exe/ruby_ast_gen".freeze, "lib/ruby_ast_gen".freeze, "lib/ruby_ast_gen.rb".freeze, "lib/ruby_ast_gen/node_handling.rb".freeze, "lib/ruby_ast_gen/version.rb".freeze, "ruby_ast_gen.gemspec".freeze]
|
|
18
|
+
s.homepage = "https://github.com/appthreat/ruby_ast_gen".freeze
|
|
19
|
+
s.licenses = ["MIT".freeze]
|
|
20
|
+
s.required_ruby_version = Gem::Requirement.new(">= 3.1.4".freeze)
|
|
21
|
+
s.rubygems_version = "3.6.7".freeze
|
|
22
|
+
s.summary = "A Ruby parser than dumps the AST as JSON output".freeze
|
|
23
|
+
|
|
24
|
+
s.installed_by_version = "3.6.7".freeze
|
|
25
|
+
end
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'tempfile'
|
|
4
|
+
|
|
5
|
+
RSpec.describe RubyAstGen do
|
|
6
|
+
temp_name = ""
|
|
7
|
+
let(:temp_file) {
|
|
8
|
+
file = Tempfile.new('test_ruby_code')
|
|
9
|
+
temp_name = File.basename(file.path)
|
|
10
|
+
file
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
after(:each) do
|
|
14
|
+
temp_file.close
|
|
15
|
+
temp_file.unlink
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def code(s)
|
|
19
|
+
temp_file.write(s)
|
|
20
|
+
temp_file.rewind
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it "should parse a class successfully" do
|
|
24
|
+
code(<<-CODE)
|
|
25
|
+
class Foo
|
|
26
|
+
CONST = 1
|
|
27
|
+
end
|
|
28
|
+
CODE
|
|
29
|
+
ast = RubyAstGen::parse_file(temp_file.path, temp_name)
|
|
30
|
+
expect(ast).not_to be_nil
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "should parse assignment to HEREDOCs successfully" do
|
|
34
|
+
code(<<-CODE)
|
|
35
|
+
multi_line_string = <<-TEXT
|
|
36
|
+
This is a multi-line string.
|
|
37
|
+
You can freely write across
|
|
38
|
+
multiple lines using heredoc.
|
|
39
|
+
TEXT
|
|
40
|
+
CODE
|
|
41
|
+
ast = RubyAstGen::parse_file(temp_file.path, temp_name)
|
|
42
|
+
expect(ast).not_to be_nil
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
it "should parse call with HEREDOC args successfully" do
|
|
47
|
+
code(<<-CODE)
|
|
48
|
+
puts(<<-ARG1, <<-ARG2)
|
|
49
|
+
This is the first HEREDOC.
|
|
50
|
+
It spans multiple lines.
|
|
51
|
+
ARG1
|
|
52
|
+
This is the second HEREDOC.
|
|
53
|
+
It also spans multiple lines.
|
|
54
|
+
ARG2
|
|
55
|
+
CODE
|
|
56
|
+
ast = RubyAstGen::parse_file(temp_file.path, temp_name)
|
|
57
|
+
expect(ast).not_to be_nil
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
it "should create a singleton object body successfully" do
|
|
61
|
+
code(<<-CODE)
|
|
62
|
+
class C
|
|
63
|
+
class << self
|
|
64
|
+
def f(x)
|
|
65
|
+
x + 1
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
CODE
|
|
70
|
+
ast = RubyAstGen::parse_file(temp_file.path, temp_name)
|
|
71
|
+
expect(ast).not_to be_nil
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
it "should create an operator assignment successfully" do
|
|
75
|
+
code(<<-CODE)
|
|
76
|
+
def foo(x)
|
|
77
|
+
x += 1
|
|
78
|
+
end
|
|
79
|
+
CODE
|
|
80
|
+
ast = RubyAstGen::parse_file(temp_file.path, temp_name)
|
|
81
|
+
expect(ast).not_to be_nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
it "should create a function with a keyword option argument sucessfully" do
|
|
85
|
+
code(<<-CODE)
|
|
86
|
+
def foo(a, bar: "default")
|
|
87
|
+
puts(bar)
|
|
88
|
+
end
|
|
89
|
+
CODE
|
|
90
|
+
ast = RubyAstGen::parse_file(temp_file.path, temp_name)
|
|
91
|
+
expect(ast).not_to be_nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
it "should parse a large code snippet sucessfully" do
|
|
95
|
+
code(<<-CODE)
|
|
96
|
+
# frozen_string_literal: true
|
|
97
|
+
Railsgoat::Application.routes.draw do
|
|
98
|
+
|
|
99
|
+
get "login" => "sessions#new"
|
|
100
|
+
get "signup" => "users#new"
|
|
101
|
+
get "logout" => "sessions#destroy"
|
|
102
|
+
|
|
103
|
+
get "forgot_password" => "password_resets#forgot_password"
|
|
104
|
+
post "forgot_password" => "password_resets#send_forgot_password"
|
|
105
|
+
get "password_resets" => "password_resets#confirm_token"
|
|
106
|
+
post "password_resets" => "password_resets#reset_password"
|
|
107
|
+
|
|
108
|
+
get "dashboard/doc" => "dashboard#doc"
|
|
109
|
+
|
|
110
|
+
resources :sessions
|
|
111
|
+
|
|
112
|
+
resources :users do
|
|
113
|
+
get "account_settings"
|
|
114
|
+
|
|
115
|
+
resources :retirement
|
|
116
|
+
resources :paid_time_off
|
|
117
|
+
resources :work_info
|
|
118
|
+
resources :performance
|
|
119
|
+
resources :benefit_forms
|
|
120
|
+
resources :messages
|
|
121
|
+
|
|
122
|
+
resources :pay do
|
|
123
|
+
collection do
|
|
124
|
+
post "update_dd_info"
|
|
125
|
+
post "decrypted_bank_acct_num"
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
get "download" => "benefit_forms#download"
|
|
132
|
+
post "upload" => "benefit_forms#upload"
|
|
133
|
+
|
|
134
|
+
resources :tutorials do
|
|
135
|
+
collection do
|
|
136
|
+
get "credentials"
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
resources :schedule do
|
|
141
|
+
collection do
|
|
142
|
+
get "get_pto_schedule"
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
resources :admin do
|
|
147
|
+
get "dashboard"
|
|
148
|
+
get "get_user"
|
|
149
|
+
post "delete_user"
|
|
150
|
+
patch "update_user"
|
|
151
|
+
get "get_all_users"
|
|
152
|
+
get "analytics"
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
resources :dashboard do
|
|
156
|
+
collection do
|
|
157
|
+
get "home"
|
|
158
|
+
get "change_graph"
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
namespace :api, defaults: {format: "json"} do
|
|
163
|
+
namespace :v1 do
|
|
164
|
+
resources :users
|
|
165
|
+
resources :mobile
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
root to: "sessions#new"
|
|
170
|
+
end
|
|
171
|
+
CODE
|
|
172
|
+
ast = RubyAstGen::parse_file(temp_file.path, temp_name)
|
|
173
|
+
expect(ast).not_to be_nil
|
|
174
|
+
end
|
|
175
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ruby_ast_gen"
|
|
4
|
+
|
|
5
|
+
RSpec.configure do |config|
|
|
6
|
+
# Enable flags like --only-failures and --next-failure
|
|
7
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
|
8
|
+
|
|
9
|
+
# Disable RSpec exposing methods globally on `Module` and `main`
|
|
10
|
+
config.disable_monkey_patching!
|
|
11
|
+
|
|
12
|
+
config.expect_with :rspec do |c|
|
|
13
|
+
c.syntax = :expect
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Script to update the version in `lib/ruby_ast_gen/version.rb`
|
|
4
|
+
require 'fileutils'
|
|
5
|
+
|
|
6
|
+
VERSION_FILE_PATH = 'lib/ruby_ast_gen/version.rb'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
if ARGV.empty?
|
|
10
|
+
puts "Usage: update_version.rb <new_version>"
|
|
11
|
+
exit 1
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
new_version = ARGV[0]
|
|
15
|
+
unless new_version.match?(/^v\d+\.\d+\.\d+$/)
|
|
16
|
+
puts "Invalid version format. Please provide a version in the format 'vX.X.X' (e.g., v1.0.0)."
|
|
17
|
+
exit 1
|
|
18
|
+
end
|
|
19
|
+
stripped_version = new_version.gsub(/^v/, '')
|
|
20
|
+
|
|
21
|
+
begin
|
|
22
|
+
contents = File.read(VERSION_FILE_PATH)
|
|
23
|
+
rescue Errno::ENOENT
|
|
24
|
+
puts "Error: Couldn't find the version file at #{VERSION_FILE_PATH}"
|
|
25
|
+
exit 1
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
new_contents = contents.gsub(/VERSION\s*=\s*["']\d+\.\d+\.\d+["']/, "VERSION = \"#{stripped_version}\"")
|
|
29
|
+
|
|
30
|
+
begin
|
|
31
|
+
File.write(VERSION_FILE_PATH, new_contents)
|
|
32
|
+
puts "Successfully updated version to #{stripped_version} in #{VERSION_FILE_PATH}"
|
|
33
|
+
rescue Errno::EACCES
|
|
34
|
+
puts "Error: Insufficient permissions to update #{VERSION_FILE_PATH}"
|
|
35
|
+
exit 1
|
|
36
|
+
end
|
|
File without changes
|
package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem_make.out
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
current directory: /home/runner/work/atom/atom/wrapper/nodejs/packages/atom-parsetools/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse
|
|
2
|
+
/opt/hostedtoolcache/Ruby/3.4.3/x64/bin/ruby extconf.rb
|
|
3
|
+
creating Makefile
|
|
4
|
+
|
|
5
|
+
current directory: /home/runner/work/atom/atom/wrapper/nodejs/packages/atom-parsetools/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse
|
|
6
|
+
make DESTDIR\= sitearchdir\=./.gem.20250512-3001-2g9kdq sitelibdir\=./.gem.20250512-3001-2g9kdq clean
|
|
7
|
+
|
|
8
|
+
current directory: /home/runner/work/atom/atom/wrapper/nodejs/packages/atom-parsetools/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse
|
|
9
|
+
make DESTDIR\= sitearchdir\=./.gem.20250512-3001-2g9kdq sitelibdir\=./.gem.20250512-3001-2g9kdq
|
|
10
|
+
compiling cparse.c
|
|
11
|
+
linking shared-object racc/cparse.so
|
|
12
|
+
|
|
13
|
+
current directory: /home/runner/work/atom/atom/wrapper/nodejs/packages/atom-parsetools/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse
|
|
14
|
+
make DESTDIR\= sitearchdir\=./.gem.20250512-3001-2g9kdq sitelibdir\=./.gem.20250512-3001-2g9kdq install
|
|
15
|
+
/usr/bin/install -c -m 0755 cparse.so ./.gem.20250512-3001-2g9kdq/racc
|
|
16
|
+
|
|
17
|
+
current directory: /home/runner/work/atom/atom/wrapper/nodejs/packages/atom-parsetools/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse
|
|
18
|
+
make DESTDIR\= sitearchdir\=./.gem.20250512-3001-2g9kdq sitelibdir\=./.gem.20250512-3001-2g9kdq clean
|
package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/racc/cparse.so
ADDED
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2011-2013 Peter Zotov <whitequark@whitequark.org>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
4
|
+
copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included
|
|
12
|
+
in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
15
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{AST} is a library for manipulating abstract syntax trees.
|
|
2
|
+
|
|
3
|
+
It embraces immutability; each AST node is inherently frozen at
|
|
4
|
+
creation, and updating a child node requires recreating that node
|
|
5
|
+
and its every parent, recursively.
|
|
6
|
+
|
|
7
|
+
This is a design choice. It does create some pressure on
|
|
8
|
+
garbage collector, but completely eliminates all concurrency
|
|
9
|
+
and aliasing problems.
|
|
10
|
+
|
|
11
|
+
See also {AST::Node}, {AST::Processor::Mixin} and {AST::Sexp} for
|
|
12
|
+
additional recommendations and design patterns.
|