@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,369 @@
|
|
|
1
|
+
# encoding: ascii-8bit
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
module Parser
|
|
5
|
+
module Source
|
|
6
|
+
|
|
7
|
+
##
|
|
8
|
+
# A buffer with source code. {Buffer} contains the source code itself,
|
|
9
|
+
# associated location information (name and first line), and takes care
|
|
10
|
+
# of encoding.
|
|
11
|
+
#
|
|
12
|
+
# A source buffer is immutable once populated.
|
|
13
|
+
#
|
|
14
|
+
# @!attribute [r] name
|
|
15
|
+
# Buffer name. If the buffer was created from a file, the name corresponds
|
|
16
|
+
# to relative path to the file.
|
|
17
|
+
# @return [String] buffer name
|
|
18
|
+
#
|
|
19
|
+
# @!attribute [r] first_line
|
|
20
|
+
# First line of the buffer, 1 by default.
|
|
21
|
+
# @return [Integer] first line
|
|
22
|
+
#
|
|
23
|
+
# @api public
|
|
24
|
+
#
|
|
25
|
+
class Buffer
|
|
26
|
+
attr_reader :name, :first_line
|
|
27
|
+
|
|
28
|
+
##
|
|
29
|
+
# @api private
|
|
30
|
+
#
|
|
31
|
+
ENCODING_RE =
|
|
32
|
+
/[\s#](en)?coding\s*[:=]\s*
|
|
33
|
+
(
|
|
34
|
+
# Special-case: there's a UTF8-MAC encoding.
|
|
35
|
+
(utf8-mac)
|
|
36
|
+
|
|
|
37
|
+
# Chew the suffix; it's there for emacs compat.
|
|
38
|
+
([A-Za-z0-9_-]+?)(-unix|-dos|-mac)
|
|
39
|
+
|
|
|
40
|
+
([A-Za-z0-9_-]+)
|
|
41
|
+
)
|
|
42
|
+
/x
|
|
43
|
+
|
|
44
|
+
##
|
|
45
|
+
# Try to recognize encoding of `string` as Ruby would, i.e. by looking for
|
|
46
|
+
# magic encoding comment or UTF-8 BOM. `string` can be in any encoding.
|
|
47
|
+
#
|
|
48
|
+
# @param [String] string
|
|
49
|
+
# @raise [Parser::UnknownEncodingInMagicComment] if the encoding is not recognized
|
|
50
|
+
# @return [String, nil] encoding name, if recognized
|
|
51
|
+
#
|
|
52
|
+
def self.recognize_encoding(string)
|
|
53
|
+
return if string.empty?
|
|
54
|
+
|
|
55
|
+
# extract the first two lines in an efficient way
|
|
56
|
+
string =~ /\A(.*)\n?(.*\n)?/
|
|
57
|
+
first_line, second_line = $1, $2
|
|
58
|
+
|
|
59
|
+
if first_line.start_with?("\xef\xbb\xbf".freeze) # BOM
|
|
60
|
+
return Encoding::UTF_8
|
|
61
|
+
elsif first_line[0, 2] == '#!'.freeze
|
|
62
|
+
encoding_line = second_line
|
|
63
|
+
else
|
|
64
|
+
encoding_line = first_line
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
return nil if encoding_line.nil? || encoding_line[0] != '#'
|
|
68
|
+
|
|
69
|
+
if (result = ENCODING_RE.match(encoding_line))
|
|
70
|
+
begin
|
|
71
|
+
Encoding.find(result[3] || result[4] || result[6])
|
|
72
|
+
rescue ArgumentError => e
|
|
73
|
+
raise Parser::UnknownEncodingInMagicComment, e.message
|
|
74
|
+
end
|
|
75
|
+
else
|
|
76
|
+
nil
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
##
|
|
81
|
+
# Recognize encoding of `input` and process it so it could be lexed.
|
|
82
|
+
#
|
|
83
|
+
# * If `input` does not contain BOM or magic encoding comment, it is
|
|
84
|
+
# kept in the original encoding.
|
|
85
|
+
# * If the detected encoding is binary, `input` is kept in binary.
|
|
86
|
+
# * Otherwise, `input` is re-encoded into UTF-8 and returned as a
|
|
87
|
+
# new string.
|
|
88
|
+
#
|
|
89
|
+
# This method mutates the encoding of `input`, but not its content.
|
|
90
|
+
#
|
|
91
|
+
# @param [String] input
|
|
92
|
+
# @return [String]
|
|
93
|
+
# @raise [EncodingError]
|
|
94
|
+
#
|
|
95
|
+
def self.reencode_string(input)
|
|
96
|
+
original_encoding = input.encoding
|
|
97
|
+
detected_encoding = recognize_encoding(input.force_encoding(Encoding::BINARY))
|
|
98
|
+
|
|
99
|
+
if detected_encoding.nil?
|
|
100
|
+
input.force_encoding(original_encoding)
|
|
101
|
+
elsif detected_encoding == Encoding::BINARY
|
|
102
|
+
input
|
|
103
|
+
else
|
|
104
|
+
input.
|
|
105
|
+
force_encoding(detected_encoding).
|
|
106
|
+
encode(Encoding::UTF_8)
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def initialize(name, first_line = 1, source: nil)
|
|
111
|
+
@name = name.to_s
|
|
112
|
+
@source = nil
|
|
113
|
+
@first_line = first_line
|
|
114
|
+
|
|
115
|
+
@lines = nil
|
|
116
|
+
@line_begins = nil
|
|
117
|
+
|
|
118
|
+
# UTF-32-reencoded source for O(1) slicing
|
|
119
|
+
@slice_source = nil
|
|
120
|
+
|
|
121
|
+
# Cache for fast lookup
|
|
122
|
+
@line_index_for_position = {}
|
|
123
|
+
|
|
124
|
+
self.source = source if source
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
##
|
|
128
|
+
# Populate this buffer from correspondingly named file.
|
|
129
|
+
#
|
|
130
|
+
# @example
|
|
131
|
+
# Parser::Source::Buffer.new('foo/bar.rb').read
|
|
132
|
+
#
|
|
133
|
+
# @return [Buffer] self
|
|
134
|
+
# @raise [ArgumentError] if already populated
|
|
135
|
+
#
|
|
136
|
+
def read
|
|
137
|
+
File.open(@name, 'rb') do |io|
|
|
138
|
+
self.source = io.read
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
self
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
##
|
|
145
|
+
# Source code contained in this buffer.
|
|
146
|
+
#
|
|
147
|
+
# @return [String] source code
|
|
148
|
+
# @raise [RuntimeError] if buffer is not populated yet
|
|
149
|
+
#
|
|
150
|
+
def source
|
|
151
|
+
if @source.nil?
|
|
152
|
+
raise RuntimeError, 'Cannot extract source from uninitialized Source::Buffer'
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
@source
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
##
|
|
159
|
+
# Populate this buffer from a string with encoding autodetection.
|
|
160
|
+
# `input` is mutated if not frozen.
|
|
161
|
+
#
|
|
162
|
+
# @param [String] input
|
|
163
|
+
# @raise [ArgumentError] if already populated
|
|
164
|
+
# @raise [EncodingError] if `input` includes invalid byte sequence for the encoding
|
|
165
|
+
# @return [String]
|
|
166
|
+
#
|
|
167
|
+
def source=(input)
|
|
168
|
+
input = input.dup if input.frozen?
|
|
169
|
+
input = self.class.reencode_string(input)
|
|
170
|
+
|
|
171
|
+
unless input.valid_encoding?
|
|
172
|
+
raise EncodingError, "invalid byte sequence in #{input.encoding.name}"
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
self.raw_source = input
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
##
|
|
179
|
+
# Populate this buffer from a string without encoding autodetection.
|
|
180
|
+
#
|
|
181
|
+
# @param [String] input
|
|
182
|
+
# @raise [ArgumentError] if already populated
|
|
183
|
+
# @return [String]
|
|
184
|
+
#
|
|
185
|
+
def raw_source=(input)
|
|
186
|
+
if @source
|
|
187
|
+
raise ArgumentError, 'Source::Buffer is immutable'
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
@source = input.gsub("\r\n".freeze, "\n".freeze).freeze
|
|
191
|
+
|
|
192
|
+
if !@source.ascii_only? &&
|
|
193
|
+
@source.encoding != Encoding::UTF_32LE &&
|
|
194
|
+
@source.encoding != Encoding::BINARY
|
|
195
|
+
@slice_source = @source.encode(Encoding::UTF_32LE)
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
def slice(start, length = nil)
|
|
200
|
+
if length.nil?
|
|
201
|
+
if start.is_a?(::Range)
|
|
202
|
+
length = start.size
|
|
203
|
+
start = start.begin
|
|
204
|
+
else
|
|
205
|
+
length = 1
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if @slice_source.nil?
|
|
210
|
+
@source[start, length]
|
|
211
|
+
else
|
|
212
|
+
@slice_source[start, length].encode(@source.encoding)
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
##
|
|
217
|
+
# Convert a character index into the source to a `[line, column]` tuple.
|
|
218
|
+
#
|
|
219
|
+
# @param [Integer] position
|
|
220
|
+
# @return [[Integer, Integer]] `[line, column]`
|
|
221
|
+
#
|
|
222
|
+
def decompose_position(position)
|
|
223
|
+
line_index = line_index_for_position(position)
|
|
224
|
+
line_begin = line_begins[line_index]
|
|
225
|
+
|
|
226
|
+
[ @first_line + line_index , position - line_begin ]
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
##
|
|
230
|
+
# Convert a character index into the source to a line number.
|
|
231
|
+
#
|
|
232
|
+
# @param [Integer] position
|
|
233
|
+
# @return [Integer] line
|
|
234
|
+
# @api private
|
|
235
|
+
#
|
|
236
|
+
def line_for_position(position)
|
|
237
|
+
line_index_for_position(position) + @first_line
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
##
|
|
241
|
+
# Convert a character index into the source to a column number.
|
|
242
|
+
#
|
|
243
|
+
# @param [Integer] position
|
|
244
|
+
# @return [Integer] column
|
|
245
|
+
# @api private
|
|
246
|
+
#
|
|
247
|
+
def column_for_position(position)
|
|
248
|
+
line_index = line_index_for_position(position)
|
|
249
|
+
position - line_begins[line_index]
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
##
|
|
253
|
+
# Return an `Array` of source code lines.
|
|
254
|
+
#
|
|
255
|
+
# @return [Array<String>]
|
|
256
|
+
#
|
|
257
|
+
def source_lines
|
|
258
|
+
@lines ||= begin
|
|
259
|
+
lines = @source.lines.to_a
|
|
260
|
+
lines << ''.dup if @source.end_with?("\n".freeze)
|
|
261
|
+
|
|
262
|
+
lines.each do |line|
|
|
263
|
+
line.chomp!("\n".freeze)
|
|
264
|
+
line.freeze
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
lines.freeze
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
##
|
|
272
|
+
# Extract line `lineno` from source, taking `first_line` into account.
|
|
273
|
+
#
|
|
274
|
+
# @param [Integer] lineno
|
|
275
|
+
# @return [String]
|
|
276
|
+
# @raise [IndexError] if `lineno` is out of bounds
|
|
277
|
+
#
|
|
278
|
+
def source_line(lineno)
|
|
279
|
+
source_lines.fetch(lineno - @first_line).dup
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
##
|
|
283
|
+
# Extract line `lineno` as a new `Range`, taking `first_line` into account.
|
|
284
|
+
#
|
|
285
|
+
# @param [Integer] lineno
|
|
286
|
+
# @return [Range]
|
|
287
|
+
# @raise [IndexError] if `lineno` is out of bounds
|
|
288
|
+
#
|
|
289
|
+
def line_range(lineno)
|
|
290
|
+
index = lineno - @first_line
|
|
291
|
+
if index < 0 || index + 1 >= line_begins.size
|
|
292
|
+
raise IndexError, 'Parser::Source::Buffer: range for line ' \
|
|
293
|
+
"#{lineno} requested, valid line numbers are #{@first_line}.." \
|
|
294
|
+
"#{@first_line + line_begins.size - 2}"
|
|
295
|
+
else
|
|
296
|
+
Range.new(self, line_begins[index], line_begins[index + 1] - 1)
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
##
|
|
301
|
+
# @return [Range] A range covering the whole source
|
|
302
|
+
#
|
|
303
|
+
def source_range
|
|
304
|
+
@source_range ||= Range.new(self, 0, source.size)
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
##
|
|
308
|
+
# Number of last line in the buffer
|
|
309
|
+
#
|
|
310
|
+
# @return [Integer]
|
|
311
|
+
#
|
|
312
|
+
def last_line
|
|
313
|
+
line_begins.size + @first_line - 2
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# :nodoc:
|
|
317
|
+
def freeze
|
|
318
|
+
source_lines; line_begins; source_range # build cache
|
|
319
|
+
super
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# :nodoc:
|
|
323
|
+
def inspect
|
|
324
|
+
"#<#{self.class} #{name}>"
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
private
|
|
328
|
+
|
|
329
|
+
# @returns [0, line_begin_of_line_1, ..., source.size + 1]
|
|
330
|
+
def line_begins
|
|
331
|
+
@line_begins ||= begin
|
|
332
|
+
begins = [0]
|
|
333
|
+
index = 0
|
|
334
|
+
while index = @source.index("\n".freeze, index)
|
|
335
|
+
index += 1
|
|
336
|
+
begins << index
|
|
337
|
+
end
|
|
338
|
+
begins << @source.size + 1
|
|
339
|
+
begins
|
|
340
|
+
end
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# @returns 0-based line index of position
|
|
344
|
+
def line_index_for_position(position)
|
|
345
|
+
@line_index_for_position[position] || begin
|
|
346
|
+
index = bsearch(line_begins, position) - 1
|
|
347
|
+
@line_index_for_position[position] = index unless @line_index_for_position.frozen?
|
|
348
|
+
index
|
|
349
|
+
end
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
if Array.method_defined?(:bsearch_index) # RUBY_VERSION >= 2.3
|
|
353
|
+
def bsearch(line_begins, position)
|
|
354
|
+
line_begins.bsearch_index do |line_begin|
|
|
355
|
+
position < line_begin
|
|
356
|
+
end || line_begins.size - 1 # || only for out of bound values
|
|
357
|
+
end
|
|
358
|
+
else
|
|
359
|
+
def bsearch(line_begins, position)
|
|
360
|
+
@line_range ||= 0...line_begins.size
|
|
361
|
+
@line_range.bsearch do |i|
|
|
362
|
+
position < line_begins[i]
|
|
363
|
+
end || line_begins.size - 1 # || only for out of bound values
|
|
364
|
+
end
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
end
|
|
369
|
+
end
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Parser
|
|
4
|
+
module Source
|
|
5
|
+
|
|
6
|
+
##
|
|
7
|
+
# A processor which associates AST nodes with comments based on their
|
|
8
|
+
# location in source code. It may be used, for example, to implement
|
|
9
|
+
# rdoc-style processing.
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# require 'parser/current'
|
|
13
|
+
#
|
|
14
|
+
# ast, comments = Parser::CurrentRuby.parse_with_comments(<<-CODE)
|
|
15
|
+
# # Class stuff
|
|
16
|
+
# class Foo
|
|
17
|
+
# # Attr stuff
|
|
18
|
+
# # @see bar
|
|
19
|
+
# attr_accessor :foo
|
|
20
|
+
# end
|
|
21
|
+
# CODE
|
|
22
|
+
#
|
|
23
|
+
# p Parser::Source::Comment.associate(ast, comments)
|
|
24
|
+
# # => {
|
|
25
|
+
# # (class (const nil :Foo) ...) =>
|
|
26
|
+
# # [#<Parser::Source::Comment (string):1:1 "# Class stuff">],
|
|
27
|
+
# # (send nil :attr_accessor (sym :foo)) =>
|
|
28
|
+
# # [#<Parser::Source::Comment (string):3:3 "# Attr stuff">,
|
|
29
|
+
# # #<Parser::Source::Comment (string):4:3 "# @see bar">]
|
|
30
|
+
# # }
|
|
31
|
+
#
|
|
32
|
+
# @see {associate}
|
|
33
|
+
#
|
|
34
|
+
# @!attribute skip_directives
|
|
35
|
+
# Skip file processing directives disguised as comments.
|
|
36
|
+
# Namely:
|
|
37
|
+
#
|
|
38
|
+
# * Shebang line,
|
|
39
|
+
# * Magic encoding comment.
|
|
40
|
+
#
|
|
41
|
+
# @return [Boolean]
|
|
42
|
+
#
|
|
43
|
+
# @api public
|
|
44
|
+
#
|
|
45
|
+
class Comment::Associator
|
|
46
|
+
attr_accessor :skip_directives
|
|
47
|
+
|
|
48
|
+
##
|
|
49
|
+
# @param [Parser::AST::Node] ast
|
|
50
|
+
# @param [Array<Parser::Source::Comment>] comments
|
|
51
|
+
def initialize(ast, comments)
|
|
52
|
+
@ast = ast
|
|
53
|
+
@comments = comments
|
|
54
|
+
|
|
55
|
+
@skip_directives = true
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
##
|
|
59
|
+
# Compute a mapping between AST nodes and comments. Comment is
|
|
60
|
+
# associated with the node, if it is one of the following types:
|
|
61
|
+
#
|
|
62
|
+
# - preceding comment, it ends before the node start
|
|
63
|
+
# - sparse comment, it is located inside the node, after all child nodes
|
|
64
|
+
# - decorating comment, it starts at the same line, where the node ends
|
|
65
|
+
#
|
|
66
|
+
# This rule is unambiguous and produces the result
|
|
67
|
+
# one could reasonably expect; for example, this code
|
|
68
|
+
#
|
|
69
|
+
# # foo
|
|
70
|
+
# hoge # bar
|
|
71
|
+
# + fuga
|
|
72
|
+
#
|
|
73
|
+
# will result in the following association:
|
|
74
|
+
#
|
|
75
|
+
# {
|
|
76
|
+
# (send (lvar :hoge) :+ (lvar :fuga)) =>
|
|
77
|
+
# [#<Parser::Source::Comment (string):2:1 "# foo">],
|
|
78
|
+
# (lvar :fuga) =>
|
|
79
|
+
# [#<Parser::Source::Comment (string):3:8 "# bar">]
|
|
80
|
+
# }
|
|
81
|
+
#
|
|
82
|
+
# Note that comments after the end of the end of a passed tree range are
|
|
83
|
+
# ignored (except root decorating comment).
|
|
84
|
+
#
|
|
85
|
+
# Note that {associate} produces unexpected result for nodes which are
|
|
86
|
+
# equal but have distinct locations; comments for these nodes are merged.
|
|
87
|
+
# You may prefer using {associate_by_identity} or {associate_locations}.
|
|
88
|
+
#
|
|
89
|
+
# @return [Hash<Parser::AST::Node, Array<Parser::Source::Comment>>]
|
|
90
|
+
# @deprecated Use {associate_locations}.
|
|
91
|
+
#
|
|
92
|
+
def associate
|
|
93
|
+
@map_using = :eql
|
|
94
|
+
do_associate
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
##
|
|
98
|
+
# Same as {associate}, but uses `node.loc` instead of `node` as
|
|
99
|
+
# the hash key, thus producing an unambiguous result even in presence
|
|
100
|
+
# of equal nodes.
|
|
101
|
+
#
|
|
102
|
+
# @return [Hash<Parser::Source::Map, Array<Parser::Source::Comment>>]
|
|
103
|
+
#
|
|
104
|
+
def associate_locations
|
|
105
|
+
@map_using = :location
|
|
106
|
+
do_associate
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
##
|
|
110
|
+
# Same as {associate}, but compares by identity, thus producing an unambiguous
|
|
111
|
+
# result even in presence of equal nodes.
|
|
112
|
+
#
|
|
113
|
+
# @return [Hash<Parser::Source::Node, Array<Parser::Source::Comment>>]
|
|
114
|
+
#
|
|
115
|
+
def associate_by_identity
|
|
116
|
+
@map_using = :identity
|
|
117
|
+
do_associate
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
private
|
|
121
|
+
|
|
122
|
+
POSTFIX_TYPES = Set[:if, :while, :while_post, :until, :until_post, :masgn].freeze
|
|
123
|
+
def children_in_source_order(node)
|
|
124
|
+
if POSTFIX_TYPES.include?(node.type)
|
|
125
|
+
# All these types have either nodes with expressions, or `nil`
|
|
126
|
+
# so a compact will do, but they need to be sorted.
|
|
127
|
+
node.children.compact.sort_by { |child| child.loc.expression.begin_pos }
|
|
128
|
+
else
|
|
129
|
+
node.children.select do |child|
|
|
130
|
+
child.is_a?(AST::Node) && child.loc && child.loc.expression
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def do_associate
|
|
136
|
+
@mapping = Hash.new { |h, k| h[k] = [] }
|
|
137
|
+
@mapping.compare_by_identity if @map_using == :identity
|
|
138
|
+
@comment_num = -1
|
|
139
|
+
advance_comment
|
|
140
|
+
|
|
141
|
+
advance_through_directives if @skip_directives
|
|
142
|
+
|
|
143
|
+
visit(@ast) if @ast
|
|
144
|
+
|
|
145
|
+
@mapping
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def visit(node)
|
|
149
|
+
process_leading_comments(node)
|
|
150
|
+
|
|
151
|
+
return unless @current_comment
|
|
152
|
+
|
|
153
|
+
# If the next comment is beyond the last line of this node, we don't
|
|
154
|
+
# need to iterate over its subnodes
|
|
155
|
+
# (Unless this node is a heredoc... there could be a comment in its body,
|
|
156
|
+
# inside an interpolation)
|
|
157
|
+
node_loc = node.location
|
|
158
|
+
if @current_comment.location.line <= node_loc.last_line ||
|
|
159
|
+
node_loc.is_a?(Map::Heredoc)
|
|
160
|
+
children_in_source_order(node).each { |child| visit(child) }
|
|
161
|
+
|
|
162
|
+
process_trailing_comments(node)
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def process_leading_comments(node)
|
|
167
|
+
return if node.type == :begin
|
|
168
|
+
while current_comment_before?(node) # preceding comment
|
|
169
|
+
associate_and_advance_comment(node)
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def process_trailing_comments(node)
|
|
174
|
+
while current_comment_before_end?(node)
|
|
175
|
+
associate_and_advance_comment(node) # sparse comment
|
|
176
|
+
end
|
|
177
|
+
while current_comment_decorates?(node)
|
|
178
|
+
associate_and_advance_comment(node) # decorating comment
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
def advance_comment
|
|
183
|
+
@comment_num += 1
|
|
184
|
+
@current_comment = @comments[@comment_num]
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
def current_comment_before?(node)
|
|
188
|
+
return false if !@current_comment
|
|
189
|
+
comment_loc = @current_comment.location.expression
|
|
190
|
+
node_loc = node.location.expression
|
|
191
|
+
comment_loc.end_pos <= node_loc.begin_pos
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def current_comment_before_end?(node)
|
|
195
|
+
return false if !@current_comment
|
|
196
|
+
comment_loc = @current_comment.location.expression
|
|
197
|
+
node_loc = node.location.expression
|
|
198
|
+
comment_loc.end_pos <= node_loc.end_pos
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def current_comment_decorates?(node)
|
|
202
|
+
return false if !@current_comment
|
|
203
|
+
@current_comment.location.line == node.location.last_line
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def associate_and_advance_comment(node)
|
|
207
|
+
key = @map_using == :location ? node.location : node
|
|
208
|
+
@mapping[key] << @current_comment
|
|
209
|
+
advance_comment
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
MAGIC_COMMENT_RE = /^#\s*(-\*-|)\s*(frozen_string_literal|warn_indent|warn_past_scope):.*\1$/
|
|
213
|
+
|
|
214
|
+
def advance_through_directives
|
|
215
|
+
# Skip shebang.
|
|
216
|
+
if @current_comment && @current_comment.text.start_with?('#!'.freeze)
|
|
217
|
+
advance_comment
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Skip magic comments.
|
|
221
|
+
if @current_comment && @current_comment.text =~ MAGIC_COMMENT_RE
|
|
222
|
+
advance_comment
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Skip encoding line.
|
|
226
|
+
if @current_comment && @current_comment.text =~ Buffer::ENCODING_RE
|
|
227
|
+
advance_comment
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
end
|
|
233
|
+
end
|