@appthreat/atom-parsetools 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +78 -0
- package/astgen.js +421 -0
- package/index.js +1 -0
- package/package.json +53 -0
- package/phpastgen.js +33 -0
- package/plugins/.gitkeep +0 -0
- package/plugins/autoload.php +22 -0
- package/plugins/bin/bundler +14 -0
- package/plugins/bin/php-parse +119 -0
- package/plugins/bin/ruby_ast_gen +14 -0
- package/plugins/composer/ClassLoader.php +579 -0
- package/plugins/composer/InstalledVersions.php +396 -0
- package/plugins/composer/LICENSE +21 -0
- package/plugins/composer/autoload_classmap.php +260 -0
- package/plugins/composer/autoload_namespaces.php +9 -0
- package/plugins/composer/autoload_psr4.php +10 -0
- package/plugins/composer/autoload_real.php +36 -0
- package/plugins/composer/autoload_static.php +286 -0
- package/plugins/composer/installed.json +65 -0
- package/plugins/composer/installed.php +32 -0
- package/plugins/log4j2.xml +13 -0
- package/plugins/nikic/php-parser/LICENSE +29 -0
- package/plugins/nikic/php-parser/README.md +225 -0
- package/plugins/nikic/php-parser/bin/php-parse +205 -0
- package/plugins/nikic/php-parser/composer.json +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +148 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Class_.php +146 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +85 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +117 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +73 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Function_.php +67 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +93 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Method.php +146 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +45 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Param.php +168 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Property.php +161 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +64 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +148 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +78 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder/Use_.php +49 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Builder.php +13 -0
- package/plugins/nikic/php-parser/lib/PhpParser/BuilderFactory.php +399 -0
- package/plugins/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +335 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Comment/Doc.php +7 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Comment.php +239 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +6 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +229 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Error.php +180 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +46 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +18 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler.php +13 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +27 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/Differ.php +164 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +64 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +286 -0
- package/plugins/nikic/php-parser/lib/PhpParser/JsonDecoder.php +103 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +251 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +56 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +47 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +44 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +76 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +23 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +62 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +23 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +67 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +105 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +25 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Lexer.php +560 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NameContext.php +285 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Arg.php +46 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Attribute.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +29 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +14 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Const_.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +79 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +40 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +17 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +12 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +26 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +79 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +35 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +45 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +45 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +35 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +35 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +46 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +36 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr.php +9 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Identifier.php +75 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +50 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +50 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Name.php +254 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/NullableType.php +28 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Param.php +60 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +77 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +80 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +16 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +28 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +157 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar.php +7 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +85 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +109 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +161 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +137 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +40 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +33 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +47 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +77 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +39 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +43 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +31 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +17 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +91 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +37 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +13 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +32 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +38 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +30 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +52 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +47 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +34 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt.php +9 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/UnionType.php +28 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +17 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +27 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Node.php +151 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeAbstract.php +178 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeDumper.php +206 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeFinder.php +81 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverser.php +291 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +29 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +20 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +48 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +50 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +260 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +52 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +41 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor.php +72 -0
- package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +25 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +55 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php5.php +2682 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php7.php +2898 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +148 -0
- package/plugins/nikic/php-parser/lib/PhpParser/Parser.php +18 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ParserAbstract.php +1060 -0
- package/plugins/nikic/php-parser/lib/PhpParser/ParserFactory.php +76 -0
- package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +1126 -0
- package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +1576 -0
- package/plugins/rubyastgen/.bundle/config +5 -0
- package/plugins/rubyastgen/Gemfile +12 -0
- package/plugins/rubyastgen/Gemfile.lock +34 -0
- package/plugins/rubyastgen/bundle/bundler/setup.rb +42 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/racc +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby-parse +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby-rewrite +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/ruby_ast_gen +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/.rspec +3 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/Gemfile +10 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/LICENSE.txt +213 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/README.md +46 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/Rakefile +8 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/bin/console +11 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/bin/setup +6 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/exe/ruby_ast_gen +59 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen/node_handling.rb +232 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen/version.rb +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/lib/ruby_ast_gen.rb +140 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/ruby_ast_gen.gemspec +25 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/spec/ruby_ast_gen_spec.rb +175 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/spec/spec_helper.rb +15 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-d8b5c5740b5a/update_version.rb +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem.build_complete +0 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem_make.out +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/racc/cparse.so +0 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/LICENSE.MIT +20 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/README.YARD.md +12 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/node.rb +268 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/processor/mixin.rb +288 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/processor.rb +12 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast/sexp.rb +30 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ast-2.4.3/lib/ast.rb +17 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/BSDL +22 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/COPYING +56 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/Gemfile +10 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/README.md +69 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/Rakefile +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/bin/console +14 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/bin/setup +8 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/lib/ostruct.rb +489 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.1/ostruct.gemspec +24 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/LICENSE.txt +26 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/bin/ruby-parse +7 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/bin/ruby-rewrite +7 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/gauntlet_parser.rb +123 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/all.rb +17 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ast/node.rb +40 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ast/processor.rb +293 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/base.rb +294 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/builders/default.rb +2351 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/clobbering_error.rb +13 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/color.rb +32 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/context.rb +51 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/current.rb +146 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/current_arg_stack.rb +46 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/deprecation.rb +13 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/diagnostic/engine.rb +104 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/diagnostic.rb +163 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/dedenter.rb +88 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/explanation.rb +55 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/literal.rb +284 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer/stack_state.rb +49 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-F0.rb +12931 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-F1.rb +14884 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/lexer-strings.rb +5433 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/macruby.rb +9634 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/max_numparam_stack.rb +56 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/messages.rb +125 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/meta.rb +48 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/rewriter.rb +105 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby18.rb +9272 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby19.rb +9558 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby20.rb +10229 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby21.rb +10203 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby22.rb +10302 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby23.rb +10322 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby24.rb +10454 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby25.rb +10374 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby26.rb +10352 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby27.rb +11948 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby30.rb +12244 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby31.rb +12717 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby32.rb +12705 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby33.rb +12590 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/ruby34.rb +12597 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/rubymotion.rb +9515 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner/ruby_parse.rb +157 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner/ruby_rewrite.rb +101 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/runner.rb +299 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/buffer.rb +369 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/comment/associator.rb +233 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/comment.rb +134 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/collection.rb +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/condition.rb +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/constant.rb +32 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/definition.rb +23 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/for.rb +19 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/heredoc.rb +19 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/index.rb +33 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/keyword.rb +20 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/method_definition.rb +25 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/objc_kwarg.rb +19 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/operator.rb +17 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/rescue_body.rb +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/send.rb +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/ternary.rb +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map/variable.rb +31 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/map.rb +186 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/range.rb +326 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/rewriter/action.rb +44 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/rewriter.rb +513 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/tree_rewriter/action.rb +243 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/tree_rewriter.rb +431 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/static_environment.rb +134 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/syntax_error.rb +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/tree_rewriter.rb +133 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/unknown_encoding_in_magic_comment_error.rb +15 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/variables_stack.rb +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/version.rb +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser.rb +91 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/parser.gemspec +43 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/BSDL +22 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/COPYING +56 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ChangeLog +846 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/TODO +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/bin/racc +320 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/en/grammar.en.rdoc +218 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/en/grammar2.en.rdoc +219 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/command.ja.html +99 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/debug.ja.rdoc +36 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/grammar.ja.rdoc +348 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/index.ja.html +10 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/parser.ja.rdoc +125 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/doc/ja/usage.ja.html +414 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +273 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/cparse.c +840 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/extconf.rb +8 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/compat.rb +33 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/debugflags.rb +60 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/exception.rb +16 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/grammar.rb +1191 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/grammarfileparser.rb +667 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/info.rb +18 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/iset.rb +92 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/logfilegenerator.rb +212 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parser-text.rb +644 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parser.rb +630 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/parserfilegenerator.rb +473 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/sourcetext.rb +35 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/state.rb +976 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/statetransitiontable.rb +311 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/static.rb +5 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc.rb +6 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/ast-2.4.3.gemspec +29 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/ostruct-0.6.1.gemspec +21 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/parser-3.3.8.0.gemspec +37 -0
- package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
- package/plugins/rubyastgen/setup.ps1 +4 -0
- package/plugins/rubyastgen/setup.sh +6 -0
- package/rbastgen.js +53 -0
- package/scalasem.js +365 -0
package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/parser-3.3.8.0/lib/parser/source/rewriter.rb
ADDED
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Parser
|
|
4
|
+
module Source
|
|
5
|
+
|
|
6
|
+
##
|
|
7
|
+
# {Rewriter} is deprecated. Use {TreeRewriter} instead.
|
|
8
|
+
#
|
|
9
|
+
# TreeRewriter has simplified semantics, and customizable policies
|
|
10
|
+
# with regards to clobbering. Please read the documentation.
|
|
11
|
+
#
|
|
12
|
+
# Keep in mind:
|
|
13
|
+
# - Rewriter was discarding the `end_pos` of the given range for `insert_before`,
|
|
14
|
+
# and the `begin_pos` for `insert_after`. These are meaningful in TreeRewriter.
|
|
15
|
+
# - TreeRewriter's wrap/insert_before/insert_after are multiple by default, while
|
|
16
|
+
# Rewriter would raise clobbering errors if the non '_multi' version was called.
|
|
17
|
+
# - The TreeRewriter policy closest to Rewriter's behavior is:
|
|
18
|
+
# different_replacements: :raise,
|
|
19
|
+
# swallowed_insertions: :raise,
|
|
20
|
+
# crossing_deletions: :accept
|
|
21
|
+
#
|
|
22
|
+
# @!attribute [r] source_buffer
|
|
23
|
+
# @return [Source::Buffer]
|
|
24
|
+
#
|
|
25
|
+
# @!attribute [r] diagnostics
|
|
26
|
+
# @return [Diagnostic::Engine]
|
|
27
|
+
#
|
|
28
|
+
# @api public
|
|
29
|
+
# @deprecated Use {TreeRewriter}
|
|
30
|
+
#
|
|
31
|
+
class Rewriter
|
|
32
|
+
attr_reader :source_buffer
|
|
33
|
+
attr_reader :diagnostics
|
|
34
|
+
|
|
35
|
+
##
|
|
36
|
+
# @param [Source::Buffer] source_buffer
|
|
37
|
+
# @deprecated Use {TreeRewriter}
|
|
38
|
+
#
|
|
39
|
+
def initialize(source_buffer)
|
|
40
|
+
self.class.warn_of_deprecation
|
|
41
|
+
@diagnostics = Diagnostic::Engine.new
|
|
42
|
+
@diagnostics.consumer = lambda do |diag|
|
|
43
|
+
$stderr.puts diag.render
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
@source_buffer = source_buffer
|
|
47
|
+
@queue = []
|
|
48
|
+
@clobber = 0
|
|
49
|
+
@insertions = 0 # clobbered zero-length positions; index 0 is the far left
|
|
50
|
+
|
|
51
|
+
@insert_before_multi_order = 0
|
|
52
|
+
@insert_after_multi_order = 0
|
|
53
|
+
|
|
54
|
+
@pending_queue = nil
|
|
55
|
+
@pending_clobber = nil
|
|
56
|
+
@pending_insertions = nil
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
##
|
|
60
|
+
# Removes the source range.
|
|
61
|
+
#
|
|
62
|
+
# @param [Range] range
|
|
63
|
+
# @return [Rewriter] self
|
|
64
|
+
# @raise [ClobberingError] when clobbering is detected
|
|
65
|
+
# @deprecated Use {TreeRewriter#remove}
|
|
66
|
+
#
|
|
67
|
+
def remove(range)
|
|
68
|
+
append Rewriter::Action.new(range, ''.freeze)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
##
|
|
72
|
+
# Inserts new code before the given source range.
|
|
73
|
+
#
|
|
74
|
+
# @param [Range] range
|
|
75
|
+
# @param [String] content
|
|
76
|
+
# @return [Rewriter] self
|
|
77
|
+
# @raise [ClobberingError] when clobbering is detected
|
|
78
|
+
# @deprecated Use {TreeRewriter#insert_before}
|
|
79
|
+
#
|
|
80
|
+
def insert_before(range, content)
|
|
81
|
+
append Rewriter::Action.new(range.begin, content)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
##
|
|
85
|
+
# Inserts new code before and after the given source range.
|
|
86
|
+
#
|
|
87
|
+
# @param [Range] range
|
|
88
|
+
# @param [String] before
|
|
89
|
+
# @param [String] after
|
|
90
|
+
# @return [Rewriter] self
|
|
91
|
+
# @raise [ClobberingError] when clobbering is detected
|
|
92
|
+
# @deprecated Use {TreeRewriter#wrap}
|
|
93
|
+
#
|
|
94
|
+
def wrap(range, before, after)
|
|
95
|
+
append Rewriter::Action.new(range.begin, before)
|
|
96
|
+
append Rewriter::Action.new(range.end, after)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
##
|
|
100
|
+
# Inserts new code before the given source range by allowing other
|
|
101
|
+
# insertions at the same position.
|
|
102
|
+
# Note that an insertion with latter invocation comes _before_ earlier
|
|
103
|
+
# insertion at the same position in the rewritten source.
|
|
104
|
+
#
|
|
105
|
+
# @example Inserting '[('
|
|
106
|
+
# rewriter.
|
|
107
|
+
# insert_before_multi(range, '(').
|
|
108
|
+
# insert_before_multi(range, '[').
|
|
109
|
+
# process
|
|
110
|
+
#
|
|
111
|
+
# @param [Range] range
|
|
112
|
+
# @param [String] content
|
|
113
|
+
# @return [Rewriter] self
|
|
114
|
+
# @raise [ClobberingError] when clobbering is detected
|
|
115
|
+
# @deprecated Use {TreeRewriter#insert_before}
|
|
116
|
+
#
|
|
117
|
+
def insert_before_multi(range, content)
|
|
118
|
+
@insert_before_multi_order -= 1
|
|
119
|
+
append Rewriter::Action.new(range.begin, content, true, @insert_before_multi_order)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
##
|
|
123
|
+
# Inserts new code after the given source range.
|
|
124
|
+
#
|
|
125
|
+
# @param [Range] range
|
|
126
|
+
# @param [String] content
|
|
127
|
+
# @return [Rewriter] self
|
|
128
|
+
# @raise [ClobberingError] when clobbering is detected
|
|
129
|
+
# @deprecated Use {TreeRewriter#insert_after}
|
|
130
|
+
#
|
|
131
|
+
def insert_after(range, content)
|
|
132
|
+
append Rewriter::Action.new(range.end, content)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
##
|
|
136
|
+
# Inserts new code after the given source range by allowing other
|
|
137
|
+
# insertions at the same position.
|
|
138
|
+
# Note that an insertion with latter invocation comes _after_ earlier
|
|
139
|
+
# insertion at the same position in the rewritten source.
|
|
140
|
+
#
|
|
141
|
+
# @example Inserting ')]'
|
|
142
|
+
# rewriter.
|
|
143
|
+
# insert_after_multi(range, ')').
|
|
144
|
+
# insert_after_multi(range, ']').
|
|
145
|
+
# process
|
|
146
|
+
#
|
|
147
|
+
# @param [Range] range
|
|
148
|
+
# @param [String] content
|
|
149
|
+
# @return [Rewriter] self
|
|
150
|
+
# @raise [ClobberingError] when clobbering is detected
|
|
151
|
+
# @deprecated Use {TreeRewriter#insert_after}
|
|
152
|
+
#
|
|
153
|
+
def insert_after_multi(range, content)
|
|
154
|
+
@insert_after_multi_order += 1
|
|
155
|
+
append Rewriter::Action.new(range.end, content, true, @insert_after_multi_order)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
##
|
|
159
|
+
# Replaces the code of the source range `range` with `content`.
|
|
160
|
+
#
|
|
161
|
+
# @param [Range] range
|
|
162
|
+
# @param [String] content
|
|
163
|
+
# @return [Rewriter] self
|
|
164
|
+
# @raise [ClobberingError] when clobbering is detected
|
|
165
|
+
# @deprecated Use {TreeRewriter#replace}
|
|
166
|
+
#
|
|
167
|
+
def replace(range, content)
|
|
168
|
+
append Rewriter::Action.new(range, content)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
##
|
|
172
|
+
# Applies all scheduled changes to the `source_buffer` and returns
|
|
173
|
+
# modified source as a new string.
|
|
174
|
+
#
|
|
175
|
+
# @return [String]
|
|
176
|
+
# @deprecated Use {TreeRewriter#process}
|
|
177
|
+
#
|
|
178
|
+
def process
|
|
179
|
+
if in_transaction?
|
|
180
|
+
raise "Do not call #{self.class}##{__method__} inside a transaction"
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
adjustment = 0
|
|
184
|
+
source = @source_buffer.source.dup
|
|
185
|
+
|
|
186
|
+
@queue.sort.each do |action|
|
|
187
|
+
begin_pos = action.range.begin_pos + adjustment
|
|
188
|
+
end_pos = begin_pos + action.range.length
|
|
189
|
+
|
|
190
|
+
source[begin_pos...end_pos] = action.replacement
|
|
191
|
+
|
|
192
|
+
adjustment += (action.replacement.length - action.range.length)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
source
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
##
|
|
199
|
+
# Provides a protected block where a sequence of multiple rewrite actions
|
|
200
|
+
# are handled atomically. If any of the actions failed by clobbering,
|
|
201
|
+
# all the actions are rolled back.
|
|
202
|
+
#
|
|
203
|
+
# @example
|
|
204
|
+
# begin
|
|
205
|
+
# rewriter.transaction do
|
|
206
|
+
# rewriter.insert_before(range_of_something, '(')
|
|
207
|
+
# rewriter.insert_after(range_of_something, ')')
|
|
208
|
+
# end
|
|
209
|
+
# rescue Parser::ClobberingError
|
|
210
|
+
# end
|
|
211
|
+
#
|
|
212
|
+
# @raise [RuntimeError] when no block is passed
|
|
213
|
+
# @raise [RuntimeError] when already in a transaction
|
|
214
|
+
# @deprecated Use {TreeRewriter#transaction}
|
|
215
|
+
#
|
|
216
|
+
def transaction
|
|
217
|
+
unless block_given?
|
|
218
|
+
raise "#{self.class}##{__method__} requires block"
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if in_transaction?
|
|
222
|
+
raise 'Nested transaction is not supported'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@pending_queue = @queue.dup
|
|
226
|
+
@pending_clobber = @clobber
|
|
227
|
+
@pending_insertions = @insertions
|
|
228
|
+
|
|
229
|
+
yield
|
|
230
|
+
|
|
231
|
+
@queue = @pending_queue
|
|
232
|
+
@clobber = @pending_clobber
|
|
233
|
+
@insertions = @pending_insertions
|
|
234
|
+
|
|
235
|
+
self
|
|
236
|
+
ensure
|
|
237
|
+
@pending_queue = nil
|
|
238
|
+
@pending_clobber = nil
|
|
239
|
+
@pending_insertions = nil
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
private
|
|
243
|
+
|
|
244
|
+
# Schedule a code update. If it overlaps with another update, check
|
|
245
|
+
# whether they conflict, and raise a clobbering error if they do.
|
|
246
|
+
# (As a special case, zero-length ranges at the same position are
|
|
247
|
+
# considered to "overlap".) Otherwise, merge them.
|
|
248
|
+
#
|
|
249
|
+
# Updates which are adjacent to each other, but do not overlap, are also
|
|
250
|
+
# merged.
|
|
251
|
+
#
|
|
252
|
+
# RULES:
|
|
253
|
+
#
|
|
254
|
+
# - Insertion ("replacing" a zero-length range):
|
|
255
|
+
# - Two insertions at the same point conflict. This is true even
|
|
256
|
+
# if the earlier insertion has already been merged with an adjacent
|
|
257
|
+
# update, and even if they are both inserting the same text.
|
|
258
|
+
# - An insertion never conflicts with a replace or remove operation
|
|
259
|
+
# on its right or left side, which does not overlap it (in other
|
|
260
|
+
# words, which does not update BOTH its right and left sides).
|
|
261
|
+
# - An insertion always conflicts with a remove operation which spans
|
|
262
|
+
# both its sides.
|
|
263
|
+
# - An insertion conflicts with a replace operation which spans both its
|
|
264
|
+
# sides, unless the replacement text is longer than the replaced text
|
|
265
|
+
# by the size of the insertion (or more), and the portion of
|
|
266
|
+
# replacement text immediately after the insertion position is
|
|
267
|
+
# identical to the inserted text.
|
|
268
|
+
#
|
|
269
|
+
# - Removal operations never conflict with each other.
|
|
270
|
+
#
|
|
271
|
+
# - Replacement operations:
|
|
272
|
+
# - Take the portion of each replacement text which falls within:
|
|
273
|
+
# - The other operation's replaced region
|
|
274
|
+
# - The other operation's replacement text, if it extends past the
|
|
275
|
+
# end of its own replaced region (in other words, if the replacement
|
|
276
|
+
# text is longer than the text it replaces)
|
|
277
|
+
# - If and only if the taken texts are identical for both operations,
|
|
278
|
+
# they do not conflict.
|
|
279
|
+
#
|
|
280
|
+
def append(action)
|
|
281
|
+
range = action.range
|
|
282
|
+
|
|
283
|
+
# Is this an insertion?
|
|
284
|
+
if range.empty?
|
|
285
|
+
# Replacing nothing with... nothing?
|
|
286
|
+
return self if action.replacement.empty?
|
|
287
|
+
|
|
288
|
+
if !action.allow_multiple_insertions? && (conflicting = clobbered_insertion?(range))
|
|
289
|
+
raise_clobber_error(action, [conflicting])
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
record_insertion(range)
|
|
293
|
+
|
|
294
|
+
if (adjacent = adjacent_updates?(range))
|
|
295
|
+
conflicting = adjacent.find do |a|
|
|
296
|
+
a.range.overlaps?(range) &&
|
|
297
|
+
!replace_compatible_with_insertion?(a, action)
|
|
298
|
+
end
|
|
299
|
+
raise_clobber_error(action, [conflicting]) if conflicting
|
|
300
|
+
|
|
301
|
+
merge_actions!(action, adjacent)
|
|
302
|
+
else
|
|
303
|
+
active_queue << action
|
|
304
|
+
end
|
|
305
|
+
else
|
|
306
|
+
# It's a replace or remove operation.
|
|
307
|
+
if (insertions = adjacent_insertions?(range))
|
|
308
|
+
insertions.each do |insertion|
|
|
309
|
+
if range.overlaps?(insertion.range) &&
|
|
310
|
+
!replace_compatible_with_insertion?(action, insertion)
|
|
311
|
+
raise_clobber_error(action, [insertion])
|
|
312
|
+
else
|
|
313
|
+
action = merge_actions(action, [insertion])
|
|
314
|
+
active_queue.delete(insertion)
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
if (adjacent = adjacent_updates?(range))
|
|
320
|
+
if can_merge?(action, adjacent)
|
|
321
|
+
record_replace(range)
|
|
322
|
+
merge_actions!(action, adjacent)
|
|
323
|
+
else
|
|
324
|
+
raise_clobber_error(action, adjacent)
|
|
325
|
+
end
|
|
326
|
+
else
|
|
327
|
+
record_replace(range)
|
|
328
|
+
active_queue << action
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
self
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
def record_insertion(range)
|
|
336
|
+
self.active_insertions = active_insertions | (1 << range.begin_pos)
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
def record_replace(range)
|
|
340
|
+
self.active_clobber = active_clobber | clobbered_position_mask(range)
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
def clobbered_position_mask(range)
|
|
344
|
+
((1 << range.size) - 1) << range.begin_pos
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
def adjacent_position_mask(range)
|
|
348
|
+
((1 << (range.size + 2)) - 1) << (range.begin_pos - 1)
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
def adjacent_insertion_mask(range)
|
|
352
|
+
((1 << (range.size + 1)) - 1) << range.begin_pos
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
def clobbered_insertion?(insertion)
|
|
356
|
+
insertion_pos = insertion.begin_pos
|
|
357
|
+
if active_insertions & (1 << insertion_pos) != 0
|
|
358
|
+
# The clobbered insertion may have already been merged with other
|
|
359
|
+
# updates, so it won't necessarily have the same begin_pos.
|
|
360
|
+
active_queue.find do |a|
|
|
361
|
+
a.range.begin_pos <= insertion_pos && insertion_pos <= a.range.end_pos
|
|
362
|
+
end
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
def adjacent_insertions?(range)
|
|
367
|
+
# Just retrieve insertions which have not been merged with an adjacent
|
|
368
|
+
# remove or replace.
|
|
369
|
+
if active_insertions & adjacent_insertion_mask(range) != 0
|
|
370
|
+
result = active_queue.select do |a|
|
|
371
|
+
a.range.empty? && adjacent?(range, a.range)
|
|
372
|
+
end
|
|
373
|
+
result.empty? ? nil : result
|
|
374
|
+
end
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
def adjacent_updates?(range)
|
|
378
|
+
if active_clobber & adjacent_position_mask(range) != 0
|
|
379
|
+
active_queue.select { |a| adjacent?(range, a.range) }
|
|
380
|
+
end
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
def replace_compatible_with_insertion?(replace, insertion)
|
|
384
|
+
(replace.replacement.length - replace.range.size) >= insertion.range.size &&
|
|
385
|
+
(offset = insertion.range.begin_pos - replace.range.begin_pos) &&
|
|
386
|
+
replace.replacement[offset, insertion.replacement.length] == insertion.replacement
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
def can_merge?(action, existing)
|
|
390
|
+
# Compare 2 replace/remove operations (neither is an insertion)
|
|
391
|
+
range = action.range
|
|
392
|
+
|
|
393
|
+
existing.all? do |other|
|
|
394
|
+
overlap = range.intersect(other.range)
|
|
395
|
+
next true if overlap.nil? # adjacent, not overlapping
|
|
396
|
+
|
|
397
|
+
repl1_offset = overlap.begin_pos - range.begin_pos
|
|
398
|
+
repl2_offset = overlap.begin_pos - other.range.begin_pos
|
|
399
|
+
repl1_length = [other.range.length - repl2_offset,
|
|
400
|
+
other.replacement.length - repl2_offset].max
|
|
401
|
+
repl2_length = [range.length - repl1_offset,
|
|
402
|
+
action.replacement.length - repl1_offset].max
|
|
403
|
+
|
|
404
|
+
replacement1 = action.replacement[repl1_offset, repl1_length] || ''.freeze
|
|
405
|
+
replacement2 = other.replacement[repl2_offset, repl2_length] || ''.freeze
|
|
406
|
+
replacement1 == replacement2
|
|
407
|
+
end
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
def merge_actions(action, existing)
|
|
411
|
+
actions = existing.push(action).sort_by do |a|
|
|
412
|
+
[a.range.begin_pos, a.range.end_pos]
|
|
413
|
+
end
|
|
414
|
+
range = actions.first.range.join(actions.max_by { |a| a.range.end_pos }.range)
|
|
415
|
+
|
|
416
|
+
Rewriter::Action.new(range, merge_replacements(actions))
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
def merge_actions!(action, existing)
|
|
420
|
+
new_action = merge_actions(action, existing)
|
|
421
|
+
active_queue.delete(action)
|
|
422
|
+
replace_actions(existing, new_action)
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
def merge_replacements(actions)
|
|
426
|
+
result = ''.dup
|
|
427
|
+
prev_act = nil
|
|
428
|
+
|
|
429
|
+
actions.each do |act|
|
|
430
|
+
if !prev_act || act.range.disjoint?(prev_act.range)
|
|
431
|
+
result << act.replacement
|
|
432
|
+
else
|
|
433
|
+
prev_end = [prev_act.range.begin_pos + prev_act.replacement.length,
|
|
434
|
+
prev_act.range.end_pos].max
|
|
435
|
+
offset = prev_end - act.range.begin_pos
|
|
436
|
+
result << act.replacement[offset..-1] if offset < act.replacement.size
|
|
437
|
+
end
|
|
438
|
+
|
|
439
|
+
prev_act = act
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
result
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
def replace_actions(old, updated)
|
|
446
|
+
old.each { |act| active_queue.delete(act) }
|
|
447
|
+
active_queue << updated
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
def raise_clobber_error(action, existing)
|
|
451
|
+
# cannot replace 3 characters with "foobar"
|
|
452
|
+
diagnostic = Diagnostic.new(:error,
|
|
453
|
+
:invalid_action,
|
|
454
|
+
{ :action => action },
|
|
455
|
+
action.range)
|
|
456
|
+
@diagnostics.process(diagnostic)
|
|
457
|
+
|
|
458
|
+
# clobbered by: remove 3 characters
|
|
459
|
+
diagnostic = Diagnostic.new(:note,
|
|
460
|
+
:clobbered,
|
|
461
|
+
{ :action => existing[0] },
|
|
462
|
+
existing[0].range)
|
|
463
|
+
@diagnostics.process(diagnostic)
|
|
464
|
+
|
|
465
|
+
raise ClobberingError, "Parser::Source::Rewriter detected clobbering"
|
|
466
|
+
end
|
|
467
|
+
|
|
468
|
+
def in_transaction?
|
|
469
|
+
!@pending_queue.nil?
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
def active_queue
|
|
473
|
+
@pending_queue || @queue
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
def active_clobber
|
|
477
|
+
@pending_clobber || @clobber
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
def active_insertions
|
|
481
|
+
@pending_insertions || @insertions
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
def active_clobber=(value)
|
|
485
|
+
if @pending_clobber
|
|
486
|
+
@pending_clobber = value
|
|
487
|
+
else
|
|
488
|
+
@clobber = value
|
|
489
|
+
end
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
def active_insertions=(value)
|
|
493
|
+
if @pending_insertions
|
|
494
|
+
@pending_insertions = value
|
|
495
|
+
else
|
|
496
|
+
@insertions = value
|
|
497
|
+
end
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
def adjacent?(range1, range2)
|
|
501
|
+
range1.begin_pos <= range2.end_pos && range2.begin_pos <= range1.end_pos
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
DEPRECATION_WARNING = [
|
|
505
|
+
'Parser::Source::Rewriter is deprecated.',
|
|
506
|
+
'Please update your code to use Parser::Source::TreeRewriter instead'
|
|
507
|
+
].join("\n").freeze
|
|
508
|
+
|
|
509
|
+
extend Deprecation
|
|
510
|
+
end
|
|
511
|
+
|
|
512
|
+
end
|
|
513
|
+
end
|